From 30fbf2f679fb9072ea76034469ea400e33dffb62 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 4 Apr 2016 10:39:20 +0200 Subject: getopt: make sure setprogname provided by non-Linux system based on suggestion from Ruediger Meier. Reported-by: Samuel Thibault Signed-off-by: Karel Zak --- configure.ac | 1 + misc-utils/getopt.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-55-g7522