summaryrefslogtreecommitdiffstats
path: root/sys-utils/lsipc.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: replaces atexit(close_stdout) with new close_stdout_atexit()Karel Zak2019-06-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: cleanup columns[] usageKarel Zak2018-04-181-11/+21
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/timeutils: add common ISO timestamp masksJ William Piggott2017-11-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | * Start the ISO format flags at bit 0 instead of bit 1. * Remove unnecessary _8601 from ISO format flag names to avoid line wrapping and to ease readability. * ISO timestamps have date-time-timzone in common, so move the TIMEZONE flag to bit 2 causing all timestamp masks to have the first three bits set and the last four bits as timestamp 'options'. * Change the 'SPACE' flag to a 'T' flag, because it makes the code and comments more concise. * Add common ISO timestamp masks. * Implement the ISO timestamp masks in all applicable code using the strxxx_iso() functions. Signed-off-by: J William Piggott <elseifthen@gmx.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-291-2/+2
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-271-2/+1Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cleanup and fix --unknownopt issuesRuediger Meier2017-06-261-4/+5
| | | | | | | | | | | | | | | | Fixed checkusage.sh warnings: rtcwake: --unknownopt, non-empty stdout rtcwake: --unknownopt, stderr too long: 21 blockdev: --unknownopt, stderr too long: 28 lsipc: --unknownopt, stderr too long: 77 pg: --unknownopt, stderr too long: 23 renice: --unknownopt, stderr too long: 18 sulogin: --unknownopt, stderr too long: 17 write: --unknownopt, stderr too long: 12 Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: consolidate smartcols error messagesKarel Zak2017-05-181-5/+16
| | | | | | ... just to keep translators happy Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: fix options parsing and sync with man pageSami Kerola2017-05-031-2/+1Star
| | | | | | | | | Option --pid was never implemented so remove it from struct options and manual page. Interestingly this option was not in usage(). Short option string had 'u' that has never appear anywhere else, so it is also removed. Finally add options --bytes and --numeric-perms to manual page. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-201-21/+21
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: fix declarations shadowing variables in the global scope [oclint]Sami Kerola2016-07-211-3/+3
| | | | | | Fixes multiple occurences of 'optarg' overwrites. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lsipc: use strtime_short()Karel Zak2016-05-241-25/+8Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: use strtm_iso()Karel Zak2016-05-241-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: don't free shm data if no shm id is foundRomain Naour2016-03-231-2/+1Star
| | | | | | | | | | | | | There is a segfault in do_shm_global() when ipc_shm_get_info() return 0 and ipc_shm_free_info() is called. When no shm id is found, the memory allocated in shmds by ipc_shm_get_info() is already free when ipc_shm_free_info() is called. Move ipc_shm_free_info(shmds) inside the if statement where at least one shm id is found. Signed-off-by: Romain Naour <romain.naour@gmail.com>
* misc: fix some includesRuediger Meier2016-02-291-1/+0Star
| | | | | | | | | features.h: any glibc header includes this already libgen.h: was unused there sys/uio.h: for writev(3p) sys/queue.h seems like it was never used Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib: rename strmode() and setmode()Ruediger Meier2016-02-181-3/+3
| | | | | | On BSD they are part of the standard C library. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lsipc: add more resource to the limits listKarel Zak2015-08-121-12/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: cleanup usernamesKarel Zak2015-08-041-70/+38Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: check scols_line_refer_data() return codeKarel Zak2015-08-041-6/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: don't duplicate already allocated dataKarel Zak2015-08-041-105/+81Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: ifdef SHM_* macrosKarel Zak2015-08-031-1/+8
| | | | | Reported-by: Andreas Henriksson <andreas@fatal.se> Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: adjust grammar and punctuation of some messagesBenno Schulenberg2015-08-031-5/+5
| | | | | | | Also equalize three messages to one other one, and fix a typo in USE_COLORS_BY_DEFAULT. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* lsipc: cleanup {user,group}name usageKarel Zak2015-07-301-26/+27
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: value is never read [clang analyze]Karel Zak2015-07-291-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: make --id usable with all output formats and with -oKarel Zak2015-07-231-10/+18
| | | | | | | | | | | | | | This patch allows to use things like: # lsipc -m --id 47611910 -o COMMAND,SIZE,KEY --json or # lsipc -m --id 47611910 -o SIZE --bytes --noheadings --raw to get just one value for the resource. Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: the default --global is mutually exclusive with -c --id and -tKarel Zak2015-07-231-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: remove --print0 and -colon-separateKarel Zak2015-07-231-28/+8Star
| | | | | | | | These options have been originally designed for lslogins for compatibility another passwd-like tools. It does not make sense for IPC. Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: remove duplicate "Usage:"Karel Zak2015-07-231-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: default to --globalKarel Zak2015-07-201-14/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: add USE% to --globalKarel Zak2015-07-201-3/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: use sub-table for semphore elementsKarel Zak2015-07-201-18/+73
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: improve JSON outputKarel Zak2015-07-201-4/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: move outmode to coltrol structKarel Zak2015-07-201-19/+13Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: fix coding styleKarel Zak2015-07-201-419/+419
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: differentiate between UID and USER namesKarel Zak2015-07-201-46/+95
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: fix ID parsing, use full time for pretty printKarel Zak2015-07-201-3/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: cleanup -o usageKarel Zak2015-07-201-94/+76Star
| | | | | | | * support -o+AAA,BBB,CCC * keep default resource columns in getopt switch() Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: improve --globalKarel Zak2015-07-201-110/+93Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: cleanup columns indexesKarel Zak2015-07-201-48/+65
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: add COMMAND for shmemKarel Zak2015-07-201-1/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: add CTIME to shmem defaultKarel Zak2015-07-201-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lsipc: new command to list IPC facilitiesKarel Zak2015-07-201-0/+1259
Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Ondrej Oprala <ooprala@redhat.com>