From: Karel Zak Date: Mon, 4 Apr 2016 08:39:20 +0000 (+0200) Subject: getopt: make sure setprogname provided by non-Linux system X-Git-Tag: v2.28~20 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=30fbf2f679fb9072ea76034469ea400e33dffb62;p=thirdparty%2Futil-linux.git getopt: make sure setprogname provided by non-Linux system based on suggestion from Ruediger Meier. Reported-by: Samuel Thibault Signed-off-by: Karel Zak --- diff --git a/configure.ac b/configure.ac index 7efe5e501c..8a4a9311fa 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 c4144f63e4..2cff2eb85e 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