]> granicus.if.org Git - procps-ng/commitdiff
sysctl: finalizing the GLOB_* flags check
authorJaromir Capik <jcapik@redhat.com>
Thu, 28 Aug 2014 13:48:29 +0000 (15:48 +0200)
committerJaromir Capik <jcapik@redhat.com>
Thu, 28 Aug 2014 13:48:29 +0000 (15:48 +0200)
This commit properly resolves the merge conflict
caused by the following two commits:
fb6d4e6cb42ffacfbe300021f062b5057ba7015d
f8128568d671d2c07b7d2faf0bc399fb9b7bd69e

sysctl.c

index 08d5641f7d7c8493a6f57fe94c4c6b08e841a9d6..dcf3a71079bed60bc0765d26b2fc67cb2db06d05 100644 (file)
--- a/sysctl.c
+++ b/sysctl.c
@@ -500,16 +500,21 @@ static int Preload(const char *restrict const filename)
        char *name, *value;
        glob_t globbuf;
        int globerr;
+       int globflg;
        int j;
 
+       globflg = GLOB_NOCHECK;
+#ifdef GLOB_BRACE
+       globflg |= GLOB_BRACE;
+#endif
 #ifdef GLOB_TILDE
-       globerr = glob(filename, GLOB_NOCHECK | GLOB_TILDE | GLOB_BRACE, NULL, &globbuf);
+       globflg |= GLOB_TILDE;
 #else
        if (filename[0] == '~')
                xwarnx(_("GLOB_TILDE is not supported on your platform, "
                         "the tilde in \"%s\" won't be expanded."), filename);
-       globerr = glob(filename, GLOB_NOCHECK, NULL, &globbuf);
 #endif
+       globerr = glob(filename, globflg, NULL, &globbuf);
 
        if (globerr != 0 && globerr != GLOB_NOMATCH)
                xerr(EXIT_FAILURE, _("glob failed"));