diff --git a/man/networkd.conf.xml b/man/networkd.conf.xml index ab1f7becbe..9477bfe5af 100644 --- a/man/networkd.conf.xml +++ b/man/networkd.conf.xml @@ -37,9 +37,7 @@ Description - These configuration files control global network parameters. - Currently the DHCP Unique Identifier (DUID). - + These configuration files control global network parameters. diff --git a/src/basic/alloc-util.h b/src/basic/alloc-util.h index 136d2b3e68..c215c33f4b 100644 --- a/src/basic/alloc-util.h +++ b/src/basic/alloc-util.h @@ -20,7 +20,7 @@ typedef void* (*mfree_func_t)(void *p); * proceeding and smashing the stack limits. Note that by default RLIMIT_STACK is 8M on Linux. */ #define ALLOCA_MAX (4U*1024U*1024U) -#define new(t, n) ((t*) malloc_multiply((n), sizeof(t))) +#define new(t, n) ((t*) malloc_multiply(n, sizeof(t))) #define new0(t, n) ((t*) calloc((n) ?: 1, sizeof(t))) @@ -45,9 +45,9 @@ typedef void* (*mfree_func_t)(void *p); (t*) alloca0((sizeof(t)*_n_)); \ }) -#define newdup(t, p, n) ((t*) memdup_multiply(p, (n), sizeof(t))) +#define newdup(t, p, n) ((t*) memdup_multiply(p, n, sizeof(t))) -#define newdup_suffix0(t, p, n) ((t*) memdup_suffix0_multiply(p, (n), sizeof(t))) +#define newdup_suffix0(t, p, n) ((t*) memdup_suffix0_multiply(p, n, sizeof(t))) #define malloc0(n) (calloc(1, (n) ?: 1)) @@ -237,7 +237,7 @@ static inline size_t malloc_sizeof_safe(void **xp) { #define strndupa_safe(s, n) \ ({ \ const char *_t = (s); \ - (char*) memdupa_suffix0(_t, strnlen(_t, (n))); \ + (char*) memdupa_suffix0(_t, strnlen(_t, n)); \ }) /* Free every element of the array. */ diff --git a/src/journal/bsod.c b/src/journal/bsod.c index a88cb66b81..059e255ea4 100644 --- a/src/journal/bsod.c +++ b/src/journal/bsod.c @@ -103,7 +103,7 @@ static int acquire_first_emergency_log_message(char **ret) { if (r < 0) return log_error_errno(r, "Failed to read journal message: %m"); - message = memdup_suffix0((const char*)d + STRLEN("MESSAGE="), l - STRLEN("MESSAGE=")); + message = memdup_suffix0((const char*)d + strlen("MESSAGE="), l - strlen("MESSAGE=")); if (!message) return log_oom(); diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 2469451fca..8f9ecd9622 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -2507,7 +2507,7 @@ int server_new(Server **ret) { int server_init(Server *s, const char *namespace) { const char *native_socket, *syslog_socket, *stdout_socket, *varlink_socket, *e; _cleanup_fdset_free_ FDSet *fds = NULL; - int n, r, fd, varlink_fd = -EBADF; + int n, r, varlink_fd = -EBADF; bool no_sockets; assert(s); @@ -2575,7 +2575,7 @@ int server_init(Server *s, const char *namespace) { syslog_socket = strjoina(s->runtime_directory, "/dev-log"); varlink_socket = strjoina(s->runtime_directory, "/io.systemd.journal"); - for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd++) { + for (int fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd++) if (sd_is_socket_unix(fd, SOCK_DGRAM, -1, native_socket, 0) > 0) { @@ -2628,7 +2628,6 @@ int server_init(Server *s, const char *namespace) { if (r < 0) return log_oom(); } - } /* Try to restore streams, but don't bother if this fails */ (void) server_restore_streams(s, fds); diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c index 8f32a0a2ae..835348f90e 100644 --- a/src/pstore/pstore.c +++ b/src/pstore/pstore.c @@ -56,9 +56,9 @@ typedef enum PStoreStorage { } PStoreStorage; static const char* const pstore_storage_table[_PSTORE_STORAGE_MAX] = { - [PSTORE_STORAGE_NONE] = "none", + [PSTORE_STORAGE_NONE] = "none", [PSTORE_STORAGE_EXTERNAL] = "external", - [PSTORE_STORAGE_JOURNAL] = "journal", + [PSTORE_STORAGE_JOURNAL] = "journal", }; DEFINE_PRIVATE_STRING_TABLE_LOOKUP(pstore_storage, PStoreStorage); @@ -279,6 +279,7 @@ static int process_dmesg_files(PStoreList *list) { } else log_debug("Unknown backend, ignoring \"%s\".", pe->dirent.d_name); } + return 0; } diff --git a/src/shared/pretty-print.c b/src/shared/pretty-print.c index 7dd31a099f..946da5f42d 100644 --- a/src/shared/pretty-print.c +++ b/src/shared/pretty-print.c @@ -294,14 +294,12 @@ void print_separator(void) { * one line filled with spaces with ANSI underline set, followed by a second (empty) line. */ if (underline_enabled()) { - size_t i, c; - - c = columns(); + size_t c = columns(); flockfile(stdout); fputs_unlocked(ANSI_UNDERLINE, stdout); - for (i = 0; i < c; i++) + for (size_t i = 0; i < c; i++) fputc_unlocked(' ', stdout); fputs_unlocked(ANSI_NORMAL "\n\n", stdout); @@ -350,24 +348,17 @@ static int guess_type(const char **name, char ***prefixes, bool *is_collection, if (path_equal(n, "udev/hwdb.d")) ext = ".hwdb"; - - if (path_equal(n, "udev/rules.d")) + else if (path_equal(n, "udev/rules.d")) ext = ".rules"; - - if (path_equal(n, "kernel/install.d")) + else if (path_equal(n, "kernel/install.d")) ext = ".install"; - - if (path_equal(n, "systemd/ntp-units.d")) { + else if (path_equal(n, "systemd/ntp-units.d")) { coll = true; ext = ".list"; - } - - if (path_equal(n, "systemd/relabel-extra.d")) { + } else if (path_equal(n, "systemd/relabel-extra.d")) { coll = run = true; ext = ".relabel"; - } - - if (PATH_IN_SET(n, "systemd/system-preset", "systemd/user-preset")) { + } else if (PATH_IN_SET(n, "systemd/system-preset", "systemd/user-preset")) { coll = true; ext = ".preset"; }