diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
commit | 8bb05ac73a5b448b339ce0bc8d396c82c459b47f (patch) | |
tree | 1fdda006866bca20d41cb206767ea5241e36852f /sys-utils/lsipc.c | |
parent | Adding debian version 2.39.3-11. (diff) | |
download | util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.tar.xz util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.zip |
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sys-utils/lsipc.c')
-rw-r--r-- | sys-utils/lsipc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys-utils/lsipc.c b/sys-utils/lsipc.c index 0f3cd94..515788c 100644 --- a/sys-utils/lsipc.c +++ b/sys-utils/lsipc.c @@ -136,7 +136,7 @@ struct lsipc_control { }; struct lsipc_coldesc { - const char *name; + const char * const name; const char *help; const char *pretty_name; @@ -320,7 +320,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(USAGE_SEPARATOR, out); - printf(USAGE_HELP_OPTIONS(26)); + fprintf(out, USAGE_HELP_OPTIONS(26)); fprintf(out, _("\nGeneric columns:\n")); for (i = COLDESC_IDX_GEN_FIRST; i <= COLDESC_IDX_GEN_LAST; i++) @@ -342,7 +342,7 @@ static void __attribute__((__noreturn__)) usage(void) for (i = COLDESC_IDX_SUM_FIRST; i <= COLDESC_IDX_SUM_LAST; i++) fprintf(out, " %14s %s\n", coldescs[i].name, _(coldescs[i].help)); - printf(USAGE_MAN_TAIL("lsipc(1)")); + fprintf(out, USAGE_MAN_TAIL("lsipc(1)")); exit(EXIT_SUCCESS); } @@ -717,16 +717,18 @@ static void do_sem(int id, struct lsipc_control *ctl, struct libscols_table *tb) static void do_sem_global(struct lsipc_control *ctl, struct libscols_table *tb) { - struct sem_data *semds, *semdsp; + struct sem_data *semds; struct ipc_limits lim; int nsems = 0, nsets = 0; ipc_sem_get_limits(&lim); if (ipc_sem_get_info(-1, &semds) > 0) { - for (semdsp = semds; semdsp->next != NULL; semdsp = semdsp->next) { + struct sem_data *p; + + for (p = semds; p->next != NULL; p = p->next) { ++nsets; - nsems += semds->sem_nsems; + nsems += p->sem_nsems; } ipc_sem_free_info(semds); } @@ -1354,4 +1356,3 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } - |