]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
libpakfire_reload: Drop it
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jun 2021 14:32:09 +0000 (14:32 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jun 2021 14:32:09 +0000 (14:32 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
configure.ac
src/libpakfire_preload/uname.c [deleted file]

index e3061207e5ef1480a39f511f250c1fb83b881d08..af39a071466bcbbd1c3813b672548b285c30fc08 100644 (file)
@@ -519,23 +519,6 @@ tests_libpakfire_util_LDADD = \
 
 # ------------------------------------------------------------------------------
 
-lib_LTLIBRARIES += \
-       libpakfire_preload.la
-
-libpakfire_preload_la_SOURCES = \
-       src/libpakfire_preload/uname.c
-
-libpakfire_preload_la_LDFLAGS = \
-       $(AM_LDFLAGS) \
-       -shared \
-       -module \
-       -avoid-version
-
-libpakfire_preload_la_LIBADD = \
-       $(DL_LIBS)
-
-# ------------------------------------------------------------------------------
-
 dist_scripts_SCRIPTS = \
        src/scripts/check-buildroot \
        src/scripts/check-fhs \
index ab098707669183b3a1c07fdb07fad97cc5cb377f..564bafbd5c751ec420b7b4747c4568d6fdf2bdcd 100644 (file)
@@ -161,16 +161,6 @@ AC_CHECK_FUNCS([ \
        unshare
 ])
 
-save_LIBS="$LIBS"
-
-# libdl
-LIBS=
-AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
-DL_LIBS="$LIBS"
-AC_SUBST(DL_LIBS)
-
-LIBS="$save_LIBS"
-
 PKG_CHECK_MODULES([ARCHIVE], [libarchive >= 3.3.3])
 PKG_CHECK_MODULES([CURL], [libcurl])
 PKG_CHECK_MODULES([PYTHON_DEVEL], [python-${PYTHON_VERSION}-embed],
diff --git a/src/libpakfire_preload/uname.c b/src/libpakfire_preload/uname.c
deleted file mode 100644 (file)
index f766ec4..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-#include <stdio.h>
-#include <string.h>
-#include <dlfcn.h>
-#include <stdlib.h>            /* for EXIT_FAILURE */
-#include <unistd.h>            /* for _exit() */
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/syslog.h>
-#include <sys/utsname.h>
-
-#ifndef RTLD_NEXT
-#define RTLD_NEXT      ((void *) -1l)
-#endif
-
-typedef int (*uname_t)(struct utsname * buf);
-
-static void *get_libc_func(const char *funcname) {
-       char *error;
-
-       void *func = dlsym(RTLD_NEXT, funcname);
-       if ((error = dlerror()) != NULL) {
-               fprintf(stderr, "I can't locate libc function `%s' error: %s", funcname, error);
-               _exit(EXIT_FAILURE);
-       }
-
-       return func;
-}
-
-int uname(struct utsname *buf) {
-       char *env = NULL;
-
-       /* Call real uname to get the information we need. */
-       uname_t real_uname = (uname_t)get_libc_func("uname");
-       int ret = real_uname((struct utsname *) buf);
-
-       /* Replace release if requested. */
-       if ((env = getenv("UTS_RELEASE")) != NULL) {
-               snprintf(buf->release, sizeof(buf->release) - 1, "%s", env);
-       }
-
-       /* Replace machine type if requested. */
-       if ((env = getenv("UTS_MACHINE")) != NULL) {
-               snprintf(buf->machine, sizeof(buf->machine) - 1, "%s", env);
-       }
-
-       return ret;
-}