We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent caed5ee commit 393f457Copy full SHA for 393f457
source/perflib/err.c
@@ -11,13 +11,29 @@
11
#include <stdio.h>
12
#include <stdlib.h>
13
14
+#include <openssl/e_os2.h>
15
+
16
const char *progname;
17
18
+static ossl_inline void *
19
+get_progname(void)
20
+{
21
+ if (progname != NULL)
22
+ return progname;
23
24
+#if defined(__GLIBC__)
25
+ if (program_invocation_name && program_invocation_name[0])
26
+ return program_invocation_name;
27
+#endif
28
29
+ return NULL;
30
+}
31
32
void
33
vwarnx(const char *fmt, va_list ap)
34
{
- if (progname != NULL)
- fprintf(stderr, "%s: ", progname);
35
+ if (get_progname() != NULL)
36
+ fprintf(stderr, "%s: ", get_progname());
37
vfprintf(stderr, fmt, ap);
38
putc('\n', stderr);
39
}
0 commit comments