diff options
author | Karel Zak <kzak@redhat.com> | 2016-04-04 10:39:20 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2016-04-04 10:41:37 +0200 |
commit | 30fbf2f679fb9072ea76034469ea400e33dffb62 (patch) | |
tree | bb7fc336dbeec917a55ce791caa159c0883f15c3 | |
parent | 0fc63d38f3257417bc555981ba50620a60620a66 (diff) | |
download | util-linux-30fbf2f679fb9072ea76034469ea400e33dffb62.tar.gz |
getopt: make sure setprogname provided by non-Linux system
based on suggestion from Ruediger Meier.
Reported-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | misc-utils/getopt.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 7efe5e501..8a4a9311f 100644 --- a/configure.ac +++ b/configure.ac @@ -380,6 +380,7 @@ AC_CHECK_FUNCS([ \ qsort_r \ rpmatch \ scandirat \ + setprogname \ setresgid \ setresuid \ sched_setattr \ diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c index c4144f63e..2cff2eb85 100644 --- a/misc-utils/getopt.c +++ b/misc-utils/getopt.c @@ -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 |