]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ipcs: assist debugging
authorSami Kerola <kerolasa@iki.fi>
Sun, 16 Dec 2012 10:43:50 +0000 (10:43 +0000)
committerKarel Zak <kzak@redhat.com>
Wed, 19 Dec 2012 10:04:50 +0000 (11:04 +0100)
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>
sys-utils/ipcs.c

index 6ef0bbe567b6cdef1f6a3f8e6dbffdcabb1a1964..889c868809455c70806478b126184d593225c46a 100644 (file)
 
 #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'},