Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/config Don't ignore the return value of two unlink(...



details:   https://anonhg.NetBSD.org/src/rev/5429b7138091
branches:  trunk
changeset: 475027:5429b7138091
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Thu Jul 29 20:08:59 1999 +0000

description:
Don't ignore the return value of two unlink() commands, and print
some warnings instead, if unlinking fails.

Fixes PR 4634 by myself.

diffstat:

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

diffs (33 lines):

diff -r 2388e77f11f1 -r 5429b7138091 usr.sbin/config/main.c
--- a/usr.sbin/config/main.c    Thu Jul 29 19:45:32 1999 +0000
+++ b/usr.sbin/config/main.c    Thu Jul 29 20:08:59 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.40 1999/07/09 06:44:58 thorpej Exp $        */
+/*     $NetBSD: main.c,v 1.41 1999/07/29 20:08:59 hubertf Exp $        */
 
 /*
  * Copyright (c) 1992, 1993
@@ -327,7 +327,10 @@
 
        sprintf(buf, "arch/%s/include", machine);
        p = sourcepath(buf);
-       (void)unlink("machine");
+       ret = unlink("machine");
+       if (ret)
+               (void)fprintf(stderr, "config: unlink(machine): %s\n",
+                   strerror(errno));
        ret = symlink(p, "machine");
        if (ret)
                (void)fprintf(stderr, "config: symlink(machine -> %s): %s\n",
@@ -342,7 +345,10 @@
                p = estrdup("machine");
                q = machine;
        }
-       (void)unlink(q);
+       ret = unlink(q);
+       if (ret)
+               (void)fprintf(stderr, "config: unlink(%s): %s\n",
+                   q, strerror(errno));
        ret = symlink(p, q);
        if (ret)
                (void)fprintf(stderr, "config: symlink(%s -> %s): %s\n",



Home | Main Index | Thread Index | Old Index