summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extra/Configs/Config.in1
-rw-r--r--include/errno.h2
-rw-r--r--libc/misc/internals/__uClibc_main.c16
3 files changed, 10 insertions, 9 deletions
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 1573f65cd..4277f81a4 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -535,6 +535,7 @@ config UCLIBC_HAS_PROGRAM_INVOCATION_NAME
config UCLIBC_HAS___PROGNAME
bool "Support for __progname"
default y
+ depends on UCLIBC_HAS_PROGRAM_INVOCATION_NAME
help
Some packages (like openssh) like to peek into internal libc
symbols to make their output a bit more user friendly.
diff --git a/include/errno.h b/include/errno.h
index 2ad8e197f..3206ec45e 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -52,7 +52,7 @@ extern int errno;
/* The full and simple forms of the name with which the program was
invoked. These variables are set up automatically at startup based on
the value of ARGV[0] (this works only if you use GNU ld). */
-extern char *program_invocation_name, *program_invocation_short_name;
+const extern char *program_invocation_name, *program_invocation_short_name;
#endif /* __USE_GNU */
#endif /* _ERRNO_H */
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 15544790a..701e9efbf 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -122,14 +122,14 @@ extern void (*__fini_array_end []) (void) attribute_hidden;
# endif
#endif
-attribute_hidden const char *__uclibc_progname = NULL;
-#ifdef __UCLIBC_HAS___PROGNAME__
-strong_alias (__uclibc_progname, __progname)
-#endif
+attribute_hidden const char *__uclibc_progname = "";
#ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
-attribute_hidden const char *__progname_full = NULL;
-strong_alias (__uclibc_progname, program_invocation_short_name)
-strong_alias (__progname_full, program_invocation_name)
+const char *program_invocation_short_name = "";
+const char *program_invocation_name = "";
+#endif
+#ifdef __UCLIBC_HAS___PROGNAME__
+weak_alias (program_invocation_short_name, __progname)
+weak_alias (program_invocation_name, __progname_full)
#endif
/*
@@ -138,7 +138,7 @@ strong_alias (__progname_full, program_invocation_name)
*/
char **__environ = 0;
-weak_alias(__environ,environ)
+weak_alias(__environ, environ)
/* TODO: don't export __pagesize; we cant now because libpthread uses it */
size_t __pagesize = 0;