From bebb48fde0e634c1e45e00714b27c84a8da8220a Mon Sep 17 00:00:00 2001 From: Walter Harms Date: Fri, 31 Dec 2021 16:01:03 +0100 Subject: fix exit status the status of exit() is actually status & 0377 change status value to return as intended Signed-off-by: Walter Harms --- setxkbmap.c | 12 ++++++------ 1 file 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); -- cgit v1.2.3