Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sbin/ldconfig Pull up revisions 1.23-1.25 (requested by...



details:   https://anonhg.NetBSD.org/src/rev/717c8ff745d8
branches:  netbsd-1-4
changeset: 469621:717c8ff745d8
user:      he <he%NetBSD.org@localhost>
date:      Wed Oct 20 23:15:02 1999 +0000

description:
Pull up revisions 1.23-1.25 (requested by agc):
  Do not handle a missing /etc/ld.so.conf as a fatal error,
  and plug a file descriptor leak.

diffstat:

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

diffs (42 lines):

diff -r 81155af0b49f -r 717c8ff745d8 sbin/ldconfig/ldconfig.c
--- a/sbin/ldconfig/ldconfig.c  Wed Oct 20 23:10:56 1999 +0000
+++ b/sbin/ldconfig/ldconfig.c  Wed Oct 20 23:15:02 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.22.2.1 1999/10/20 23:15:02 he 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 (verbose) {
+                       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);
 }
 
@@ -260,6 +266,8 @@
                enter(dir, dp->d_name, name, dewey, ndewey);
        }
 
+       (void) closedir(dd);
+
        return (0);
 }
 



Home | Main Index | Thread Index | Old Index