]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
getopt: make sure setprogname provided by non-Linux system
authorKarel Zak <kzak@redhat.com>
Mon, 4 Apr 2016 08:39:20 +0000 (10:39 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 4 Apr 2016 08:41:37 +0000 (10:41 +0200)
based on suggestion from Ruediger Meier.

Reported-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
misc-utils/getopt.c

index 7efe5e501c1db6154130f63411e6e8210789b4fe..8a4a9311fae54a473d27550407a582b256316d77 100644 (file)
@@ -380,6 +380,7 @@ AC_CHECK_FUNCS([ \
        qsort_r \
        rpmatch \
        scandirat \
+       setprogname \
        setresgid \
        setresuid \
        sched_setattr \
index c4144f63e42bf9068955707e9d2dda9eaafbb2fe..2cff2eb85e5a89fbfa51da6d1ca780a24acc470c 100644 (file)
@@ -453,7 +453,7 @@ int main(int argc, char *argv[])
 
        if (name) {
                argv[optind - 1] = name;
-#if defined (BSD) || defined (__APPLE__)
+#if defined (HAVE_SETPROGNAME) && !defined (__linux__)
                setprogname(name);
 #endif
        } else