apparently, linux expect ld.so to be able to fill back references to
program code from dynamic libraries. This does not work on our ELF platforms. Just put the getmntent code inside the one source file that needs it, as a static function so that it does not show outside the library.
This commit is contained in:
parent
a802762885
commit
97150a8d92
82
misc/rpm/patches/patch-lib_fs_c
Normal file
82
misc/rpm/patches/patch-lib_fs_c
Normal file
@ -0,0 +1,82 @@
|
||||
$OpenBSD: patch-lib_fs_c,v 1.1 2002/04/07 00:31:55 espie Exp $
|
||||
--- lib/fs.c.orig Sun Apr 7 02:16:12 2002
|
||||
+++ lib/fs.c Sun Apr 7 02:17:44 2002
|
||||
@@ -3,6 +3,72 @@
|
||||
#include <rpmlib.h>
|
||||
#include <rpmmacro.h>
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
+#ifdef __aix__
|
||||
+#define COMMENTCHAR '*'
|
||||
+#else
|
||||
+#define COMMENTCHAR '#'
|
||||
+#endif
|
||||
+
|
||||
+#if HAVE_STRUCT_MNTTAB
|
||||
+static our_mntent * getmntent(FILE *filep) {
|
||||
+ static struct mnttab entry;
|
||||
+ static our_mntent item;
|
||||
+
|
||||
+ if (!fread(&entry, sizeof(entry), 1, filep)) return NULL;
|
||||
+ item.our_mntdir = entry.mt_filsys;
|
||||
+
|
||||
+ return &item;
|
||||
+}
|
||||
+#else
|
||||
+static our_mntent *getmntent(FILE *filep) {
|
||||
+ static our_mntent item = { NULL };
|
||||
+ char buf[1024], * start;
|
||||
+ char * chptr;
|
||||
+
|
||||
+ if (item.our_mntdir) {
|
||||
+ free(item.our_mntdir);
|
||||
+ }
|
||||
+
|
||||
+ while (fgets(buf, sizeof(buf) - 1, filep)) {
|
||||
+ /* chop off \n */
|
||||
+ buf[strlen(buf) - 1] = '\0';
|
||||
+
|
||||
+ chptr = buf;
|
||||
+ while (isspace(*chptr)) chptr++;
|
||||
+
|
||||
+ if (*chptr == COMMENTCHAR) continue;
|
||||
+
|
||||
+# if __aix__
|
||||
+ /* aix uses a screwed up file format */
|
||||
+ if (*chptr == '/') {
|
||||
+ start = chptr;
|
||||
+ while (*chptr != ':') chptr++;
|
||||
+ *chptr = '\0';
|
||||
+ item.mnt_dir = strdup(start);
|
||||
+ return &item;
|
||||
+ }
|
||||
+# else
|
||||
+ while (!isspace(*chptr) && (*chptr)) chptr++;
|
||||
+ if (!*chptr) return NULL;
|
||||
+
|
||||
+ while (isspace(*chptr) && (*chptr)) chptr++;
|
||||
+ if (!*chptr) return NULL;
|
||||
+ start = chptr;
|
||||
+
|
||||
+ while (!isspace(*chptr) && (*chptr)) chptr++;
|
||||
+ *chptr = '\0';
|
||||
+
|
||||
+ item.our_mntdir = strdup(start);
|
||||
+ return &item;
|
||||
+# endif
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
struct fsinfo {
|
||||
/*@only@*/ const char * mntPoint;
|
||||
dev_t dev;
|
||||
@@ -301,3 +367,5 @@ int rpmGetFilesystemUsage(const char **
|
||||
|
||||
return 0;
|
||||
}
|
||||
+
|
||||
+
|
Loading…
x
Reference in New Issue
Block a user