diff options
author | Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org> | 2017-03-23 21:22:07 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2017-03-24 13:40:15 +0200 |
commit | fa06b68ed7640c0e42a8a63dd9cb0bf8d4c73525 (patch) | |
tree | 7ed9c44bf679077982fc9a94050720bec29c2eb2 | |
parent | f493dfdeb49213cca4b22d33f2653d7dcb43b244 (diff) | |
download | rpm-fa06b68ed7640c0e42a8a63dd9cb0bf8d4c73525.tar.gz |
Drop local implementation of xsetprogname/xgetprogname
It can be dropped because this code was never actually enabled.
Actually, this implementation *surely* never ever compiled.
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
-rw-r--r-- | misc/Makefile.am | 1 | ||||
-rw-r--r-- | misc/rpmxprogname.c | 33 | ||||
-rw-r--r-- | misc/rpmxprogname.h | 13 | ||||
-rw-r--r-- | system.h | 6 |
4 files changed, 2 insertions, 51 deletions
diff --git a/misc/Makefile.am b/misc/Makefile.am index beb9beec8..bea011539 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -5,7 +5,6 @@ AM_CPPFLAGS += -I$(top_srcdir)/misc EXTRA_DIST = \ fnmatch.c fnmatch.h \ - rpmxprogname.c rpmxprogname.h \ stpcpy.c stpncpy.c noinst_LTLIBRARIES = libmisc.la diff --git a/misc/rpmxprogname.c b/misc/rpmxprogname.c deleted file mode 100644 index f89600613..000000000 --- a/misc/rpmxprogname.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Original author: Kamil Rytarowski - File: rpmxprogname.c - Date of creation: 2013-08-10 - License: the same as RPM itself */ - -#include "rpmxprogname.h" - -#include <string.h> /* strrchr */ - -char *_rpmxprogname = NULL; - -char *_rpmxgetprogname(void) -{ - const char *empty = ""; - - if (_rpmxprognam != NULL) /* never return NULL string */ - return _rpmxprogname; - else - return empty; -} - -void _rpmxsetprogname(const char *pn) -{ - if (pn != NULL && _rpmxprogname == NULL /* set the value only once */) { - char *p = strrchr(pn, '/'); /* locate the last occurrence of '/' */ - if (p != NULL) - _rpmxprogname = p + 1 /* strip beginning '/' */; - else - _rpmxprogname = pn; - } -} - -#endif /* _RPMXPROGNAME_H */ diff --git a/misc/rpmxprogname.h b/misc/rpmxprogname.h deleted file mode 100644 index 673c84aa2..000000000 --- a/misc/rpmxprogname.h +++ /dev/null @@ -1,13 +0,0 @@ -/* Original author: Kamil Rytarowski - File: rpmxprogname.c - Date of creation: 2013-08-10 - License: the same as RPM itself */ - -#ifndef _RPMXPROGNAME_H -#define _RPMXPROGNAME_H - -char *_rpmxgetprogname(void); -void _rpmxsetprogname(const char *pn); - -#endif /* _RPMXPROGNAME_H */ - @@ -114,10 +114,8 @@ extern int fdatasync(int fildes); # define xsetprogname(pn) /* No need to implement it in GNU LIBC. */ extern const char *__progname; # define xgetprogname(pn) __progname -#else /* Reimplement setprogname and getprogname */ -# include "misc/rpmxprogname.h" -# define xsetprogname(pn) _rpmxsetprogname(pn) -# define xgetprogname() _rpmxgetprogname() +#else +# error "Did not find any sutable implementation of xsetprogname/xgetprogname" #endif /* Take care of NLS matters. */ |