Source-Changes-HG archive

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

[src/trunk]: src/sbin/ldconfig If there is no /etc/ld.so.conf, it is not a fa...



details:   https://anonhg.NetBSD.org/src/rev/ab2a09cc1e4c
branches:  trunk
changeset: 471702:ab2a09cc1e4c
user:      agc <agc%NetBSD.org@localhost>
date:      Thu Apr 08 13:27:38 1999 +0000

description:
If there is no /etc/ld.so.conf, it is not a fatal error. Correct the return
value from the function so that the exit value to the shell is correct.

diffstat:

 sbin/ldconfig/ldconfig.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 8c3b712b1eb5 -r ab2a09cc1e4c sbin/ldconfig/ldconfig.c
--- a/sbin/ldconfig/ldconfig.c  Thu Apr 08 12:54:52 1999 +0000
+++ b/sbin/ldconfig/ldconfig.c  Thu Apr 08 13:27:38 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ldconfig.c,v 1.22 1998/12/15 22:49:42 pk Exp $ */
+/*     $NetBSD: ldconfig.c,v 1.23 1999/04/08 13:27:38 agc Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -166,8 +166,12 @@
        size_t          len;
        int             rval = 0;
 
-       if ((conf = fopen(_PATH_LD_SO_CONF, "r")) == NULL)
-               return (-1);
+       if ((conf = fopen(_PATH_LD_SO_CONF, "r")) == NULL) {
+               if (!silent) {
+                       warnx("can't open `%s'", _PATH_LD_SO_CONF);
+               }
+               return (0);
+       }
 
        while ((line = fgetln(conf, &len)) != NULL) {
                if (*line == '#' || *line == '\n')
@@ -197,6 +201,8 @@
                }
        }
 
+       (void) fclose(conf);
+
        return (rval);
 }
 



Home | Main Index | Thread Index | Old Index