Source-Changes-HG archive

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

[src/netbsd-1-4]: src/bin/ls Pull up revision 1.37 (requested by hubertf):



details:   https://anonhg.NetBSD.org/src/rev/cf34462c2f3c
branches:  netbsd-1-4
changeset: 470882:cf34462c2f3c
user:      he <he%NetBSD.org@localhost>
date:      Sat Sep 09 15:03:42 2000 +0000

description:
Pull up revision 1.37 (requested by hubertf):
  Exit with non-zero status if an error was encountered.  Fixes
  PR#7514.

diffstat:

 bin/ls/ls.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (51 lines):

diff -r a02d0555949b -r cf34462c2f3c bin/ls/ls.c
--- a/bin/ls/ls.c       Sat Aug 26 19:36:01 2000 +0000
+++ b/bin/ls/ls.c       Sat Sep 09 15:03:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ls.c,v 1.36 1999/02/17 15:28:09 kleink Exp $   */
+/*     $NetBSD: ls.c,v 1.36.2.1 2000/09/09 15:03:42 he Exp $   */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)ls.c       8.7 (Berkeley) 8/5/94";
 #else
-__RCSID("$NetBSD: ls.c,v 1.36 1999/02/17 15:28:09 kleink Exp $");
+__RCSID("$NetBSD: ls.c,v 1.36.2.1 2000/09/09 15:03:42 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -85,6 +85,7 @@
 long blocksize;                        /* block size units */
 int termwidth = 80;            /* default terminal width */
 int sortkey = BY_NAME;
+int rval = EXIT_SUCCESS;       /* exit value - set if error encountered */
 
 /* flags */
 int f_accesstime;              /* use time of last access */
@@ -327,7 +328,7 @@
                traverse(argc, argv, fts_options);
        else
                traverse(1, dotav, fts_options);
-       exit(EXIT_SUCCESS);
+       exit(rval);
        /* NOTREACHED */
 }
 
@@ -370,6 +371,7 @@
                case FTS_DNR:
                case FTS_ERR:
                        warnx("%s: %s", p->fts_name, strerror(p->fts_errno));
+                       rval = EXIT_FAILURE;
                        break;
                case FTS_D:
                        if (p->fts_level != FTS_ROOTLEVEL &&
@@ -448,6 +450,7 @@
                        warnx("%s: %s",
                            cur->fts_name, strerror(cur->fts_errno));
                        cur->fts_number = NO_PRINT;
+                       rval = EXIT_FAILURE;
                        continue;
                }
 



Home | Main Index | Thread Index | Old Index