Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sbin/ldconfig Pullup 1.31 [fvdl]:



details:   https://anonhg.NetBSD.org/src/rev/293edd643ec7
branches:  netbsd-1-5
changeset: 489907:293edd643ec7
user:      tv <tv%NetBSD.org@localhost>
date:      Wed Oct 18 16:43:25 2000 +0000

description:
Pullup 1.31 [fvdl]:
Build this on ELF as well. When on an ELF system, only look in
_PATH_EMUL_AOUT/etc/ld.so.conf.

diffstat:

 sbin/ldconfig/ldconfig.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 549382d42ea8 -r 293edd643ec7 sbin/ldconfig/ldconfig.c
--- a/sbin/ldconfig/ldconfig.c  Wed Oct 18 16:42:52 2000 +0000
+++ b/sbin/ldconfig/ldconfig.c  Wed Oct 18 16:43:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldconfig.c,v 1.30 2000/06/01 18:17:06 matt Exp $       */
+/*     $NetBSD: ldconfig.c,v 1.30.2.1 2000/10/18 16:43:25 tv Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <link.h>
+#include <link_aout.h>
 #include <paths.h>
 
 #include "shlib.h"
@@ -167,13 +167,25 @@
        char            *cline = NULL;
        size_t          len;
        int             rval = 0;
+#ifdef __ELF__
+       char            *aout_conf;
 
+       aout_conf = xmalloc(sizeof(_PATH_EMUL_AOUT) + strlen(_PATH_LD_SO_CONF));        strcpy(aout_conf, _PATH_EMUL_AOUT);
+       strcat(aout_conf, _PATH_LD_SO_CONF);
+       if ((conf = fopen(aout_conf, "r")) == NULL) {
+               if (verbose)
+                       warnx("can't open `%s'", aout_conf);
+               return (0);
+       }
+       free(aout_conf);
+#else
        if ((conf = fopen(_PATH_LD_SO_CONF, "r")) == NULL) {
                if (verbose) {
                        warnx("can't open `%s'", _PATH_LD_SO_CONF);
                }
                return (0);
        }
+#endif
 
        while ((line = fgetln(conf, &len)) != NULL) {
                if (*line != '/')



Home | Main Index | Thread Index | Old Index