diff options
author | jbj <devnull@localhost> | 1999-09-26 15:04:03 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-09-26 15:04:03 +0000 |
commit | e60094b302720378ca194db760e51299b32e0a70 (patch) | |
tree | 67e66c20dcff947fef2fa59563d364627fd1a539 /system.h | |
parent | 0464b19302bcceafe0c597f1feb693f69ab9b12d (diff) | |
download | rpm-e60094b302720378ca194db760e51299b32e0a70.tar.gz rpm-e60094b302720378ca194db760e51299b32e0a70.tar.bz2 rpm-e60094b302720378ca194db760e51299b32e0a70.zip |
Retrofit glibc __progname.
CVS patchset: 3330
CVS date: 1999/09/26 15:04:03
Diffstat (limited to 'system.h')
-rw-r--r-- | system.h | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -203,20 +203,25 @@ void *vmefail(void); #endif -#if HAVE_MCHECK_H && defined(__GNUC__) - /* Memory allocation via macro defs to get meaningful locations from mtrace() */ - +#if HAVE_MCHECK_H && defined(__GNUC__) #define xmalloc(_size) (malloc(_size) ? : vmefail()) - #define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail()) - #define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail()) - #define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str))) - #endif /* HAVE_MCHECK_H && defined(__GNUC__) */ +/* Retrofit glibc __progname */ +char *__progname; +#if defined __GLIBC__ && __GLIBC__ >= 2 +#define setprogname(pn) +#else +#define setprogname(pn) \ + { if ((__progname = strrchr(pn, '/')) __progname++; \ + else __progname = pn; \ + } +#endif + #if HAVE_NETDB_H #ifndef __LCLINT__ #include <netdb.h> |