Romain Naour
90a9b9910c
lsipc: don't free shm data if no shm id is found
...
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>
2016-03-23 10:52:41 +01:00
Ruediger Meier
eaac9f88f9
misc: fix some includes
...
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>
2016-02-29 13:04:56 +01:00
Ruediger Meier
b0b24b11f8
lib: rename strmode() and setmode()
...
On BSD they are part of the standard C library.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-02-18 12:53:48 +01:00
Karel Zak
a4839bc781
lsipc: add more resource to the limits list
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-12 10:21:48 +02:00
Karel Zak
71b63dc14f
lsipc: cleanup usernames
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 14:22:31 +02:00
Karel Zak
fadf556a70
lsipc: check scols_line_refer_data() return code
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 14:05:33 +02:00
Karel Zak
cdb4a9464d
lsipc: don't duplicate already allocated data
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-04 13:57:45 +02:00
Karel Zak
21ce5a5d70
lsipc: ifdef SHM_* macros
...
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-08-03 13:20:56 +02:00
Benno Schulenberg
62eea9ce12
textual: adjust grammar and punctuation of some messages
...
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>
2015-08-03 11:18:56 +02:00
Karel Zak
d8461c4e4d
lsipc: cleanup {user,group}name usage
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-30 09:18:33 +02:00
Karel Zak
9380fbefa6
lsipc: value is never read [clang analyze]
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-29 13:54:54 +02:00
Karel Zak
2916afa3f5
lsipc: make --id usable with all output formats and with -o
...
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>
2015-07-23 11:09:49 +02:00
Karel Zak
8f405a5bed
lsipc: the default --global is mutually exclusive with -c --id and -t
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-23 10:36:02 +02:00
Karel Zak
2a7150ac2e
lsipc: remove --print0 and -colon-separate
...
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>
2015-07-23 10:28:32 +02:00
Karel Zak
cdedcbe603
lsipc: remove duplicate "Usage:"
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-23 10:20:06 +02:00
Karel Zak
25456d5da3
lsipc: default to --global
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:56:44 +02:00
Karel Zak
1a31107169
lsipc: add USE% to --global
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
624de257a6
lsipc: use sub-table for semphore elements
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
5de8fcfd36
lsipc: improve JSON output
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
d7500c6a6b
lsipc: move outmode to coltrol struct
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
91c92cb545
lsipc: fix coding style
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
7458c061db
lsipc: differentiate between UID and USER names
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
c8b47062ab
lsipc: fix ID parsing, use full time for pretty print
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
e015417306
lsipc: cleanup -o usage
...
* support -o+AAA,BBB,CCC
* keep default resource columns in getopt switch()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
32cfe498b8
lsipc: improve --global
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
470a7332b3
lsipc: cleanup columns indexes
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
be47528713
lsipc: add COMMAND for shmem
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
be333373b5
lsipc: add CTIME to shmem default
...
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak
9d20ffda79
lsipc: new command to list IPC facilities
...
Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-07-20 11:48:09 +02:00