summaryrefslogtreecommitdiffstats
path: root/sys-utils/ipcs.c
diff options
context:
space:
mode:
authorSami Kerola2012-12-16 11:43:50 +0100
committerKarel Zak2012-12-19 11:04:50 +0100
commit7e3c5f1cc10665ba87030a1bc8a10c7cfda89fe8 (patch)
tree1ec9d302eace3648ef6f091aed4868c6dc3ee15b /sys-utils/ipcs.c
parentdocs: swapon.8 option name fix (diff)
downloadkernel-qcow2-util-linux-7e3c5f1cc10665ba87030a1bc8a10c7cfda89fe8.tar.gz
kernel-qcow2-util-linux-7e3c5f1cc10665ba87030a1bc8a10c7cfda89fe8.tar.xz
kernel-qcow2-util-linux-7e3c5f1cc10665ba87030a1bc8a10c7cfda89fe8.zip
ipcs: assist debugging
One will be able to see enum symbols when debugging, which is not the case when values are specified as define list. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/ipcs.c')
-rw-r--r--sys-utils/ipcs.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 6ef0bbe56..889c86880 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -25,11 +25,14 @@
#include "ipcutils.h"
-#define LIMITS 1
-#define STATUS 2
-#define CREATOR 3
-#define TIME 4
-#define PID 5
+enum output_formats {
+ NOTSPECIFIED,
+ LIMITS,
+ STATUS,
+ CREATOR,
+ TIME,
+ PID
+};
static void do_shm (char format);
static void print_shm (int id);
@@ -68,7 +71,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
int main (int argc, char **argv)
{
int opt, msg = 0, sem = 0, shm = 0, id=0, print=0;
- char format = 0;
+ char format = NOTSPECIFIED;
static const struct option longopts[] = {
{"id", required_argument, NULL, 'i'},
{"shmems", no_argument, NULL, 'm'},