mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-24 10:59:29 +01:00
Revert 1d87476250217a87319df48a8f473415c0515106
This commit is contained in:
parent
1d87476250
commit
326d210f17
@ -19,10 +19,9 @@
|
|||||||
Rejected in glibc (http://sourceware.org/ml/libc-alpha/2006-03/msg00125.html)
|
Rejected in glibc (http://sourceware.org/ml/libc-alpha/2006-03/msg00125.html)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsd/stdlib.h> /* progname, strdup */
|
#include <bsd/stdlib.h>
|
||||||
#include <string.h> /* free */
|
|
||||||
|
|
||||||
char *__progname = NULL;
|
static char *__progname = NULL;
|
||||||
|
|
||||||
char *
|
char *
|
||||||
getprogname ()
|
getprogname ()
|
||||||
@ -33,10 +32,5 @@ getprogname ()
|
|||||||
void
|
void
|
||||||
setprogname (char *new)
|
setprogname (char *new)
|
||||||
{
|
{
|
||||||
/* For some reason, accessing the argv vector directly may cause SIGSEV. Let's copy it to avoid trouble. */
|
__progname = new;
|
||||||
|
|
||||||
if (__progname != NULL)
|
|
||||||
free (__progname);
|
|
||||||
|
|
||||||
__progname = strdup (new);
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user