[hackers] [ubase] If at least one entry fails, return EXIT_FAILURE in sysctl || sin

From: <git_AT_suckless.org>
Date: Thu, 17 Apr 2014 18:08:56 +0200

commit edc39cef27b442815f8541a7a3abc2a78b8f54ac
Author: sin <sin_AT_2f30.org>
Date: Thu Apr 17 17:05:14 2014 +0100

    If at least one entry fails, return EXIT_FAILURE in sysctl

diff --git a/sysctl.c b/sysctl.c
index 159180a..eb656c7 100644
--- a/sysctl.c
+++ b/sysctl.c
_AT_@ -122,6 +122,7 @@ main(int argc, char *argv[])
         char *value;
         char *p;
         int i;
+ int r = EXIT_SUCCESS;
 
         argv0 = argv[0];
         argv++;
_AT_@ -133,6 +134,7 @@ main(int argc, char *argv[])
         for (i = 0; i < argc; i++) {
                 for (p = argv[i]; *p; p++) {
                         if (p[0] == '.' && p[1] == '.') {
+ r = EXIT_FAILURE;
                                 weprintf("malformed input: %s
", argv[i]);
                                 break;
                         }
_AT_@ -142,6 +144,7 @@ main(int argc, char *argv[])
                 p = strchr(argv[i], '=');
                 if (p) {
                         if (p[1] == '
Received on Thu Apr 17 2014 - 18:08:56 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 17 2014 - 18:12:17 CEST