summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter Harms <wharms@bfs.de>2021-12-31 16:01:03 +0100
committerWalter Harms <wharms@bfs.de>2021-12-31 16:01:03 +0100
commitbebb48fde0e634c1e45e00714b27c84a8da8220a (patch)
tree2ce1db9c784657c52661c7f51a7e4260f654be12
parent6ae13951f86f7117d354c1ac10bde54061c3b89d (diff)
fix exit status
the status of exit() is actually status & 0377 change status value to return as intended Signed-off-by: Walter Harms <wharms@bfs.de>
-rw-r--r--setxkbmap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/setxkbmap.c b/setxkbmap.c
index ba7830f..09727eb 100644
--- a/setxkbmap.c
+++ b/setxkbmap.c
@@ -173,7 +173,7 @@ static int deviceSpec = XkbUseCoreKbd;
#define ERR2(s,a,b) fprintf(stderr,s,a,b)
#define ERR3(s,a,b,c) fprintf(stderr,s,a,b,c)
-#define OOM(ptr) do { if ((ptr) == NULL) { ERR("Out of memory.\n"); exit(-1); } } while (0)
+#define OOM(ptr) do { if ((ptr) == NULL) { ERR("Out of memory.\n"); exit(1); } } while (0)
/***====================================================================***/
@@ -419,7 +419,7 @@ parseArgs(int argc, char **argv)
deviceSpec = atoi(argv[i]); /* only allow device IDs, not names */
} else {
usage(argc, argv);
- exit(-1);
+ exit(1);
}
}
else if (streq(argv[i], "-display"))
@@ -1116,7 +1116,7 @@ int
main(int argc, char **argv)
{
if ((!parseArgs(argc, argv)) || (!getDisplay(argc, argv)))
- exit(-1);
+ exit(1);
if (is_xwayland())
MSG("WARNING: Running setxkbmap against an XWayland server\n");
@@ -1127,11 +1127,11 @@ main(int argc, char **argv)
if (dpy)
getServerValues();
if (settings.config.value && (!applyConfig(settings.config.value)))
- exit(-3);
+ exit(3);
if (!applyRules())
- exit(-4);
+ exit(4);
if (!applyComponentNames())
- exit(-5);
+ exit(5);
if (dpy)
XCloseDisplay(dpy);
exit(0);