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>
This commit is contained in:
Gleb Fotengauer-Malinovskiy 2017-03-23 21:22:07 +03:00 committed by Panu Matilainen
parent f493dfdeb4
commit fa06b68ed7
4 changed files with 2 additions and 51 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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 */

View File

@ -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. */