summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-07-26 14:54:06 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2017-07-26 14:59:11 +0200
commitc532b58b892ae2c9696306e11fe44491740b736d (patch)
tree0241fa5ee86584ca30267bdd435aa94d0ccb7772 /main.c
parent0cfd2d8ec76692ec4567d07eb89a256c267a1527 (diff)
downloadaports-cache-c532b58b892ae2c9696306e11fe44491740b736d.tar.bz2
aports-cache-c532b58b892ae2c9696306e11fe44491740b736d.tar.xz
make use of program_invocation_name optionalHEADmaster
fixes build on linux
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index 4ee7aa8..f2320bc 100644
--- a/main.c
+++ b/main.c
@@ -11,7 +11,9 @@
#include "aports-cache.h"
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
static char *program_invocation_name;
+#endif
static void usage(int exitcode)
{
@@ -45,8 +47,9 @@ int main(int argc, char *argv[])
int dirfd, rc;
char *shell_argv[] = {"/bin/sh", NULL};
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
program_invocation_name = argv[0];
-
+#endif
while ((c = getopt_long(argc, argv, "fs:v", opts, &i)) != -1) {
switch(c) {