From b3dbeb6c53cbbf1e00ee3ce66ce4574905e5c2dd Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 27 Aug 1996 21:51:48 +0000 Subject: set error status on exit, to be consistent with manpage and standard commands. --- bin/ls/ls.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 6be4a32..fb747de 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ls.c,v 1.8 1995/10/23 21:09:01 ache Exp $ + * $Id: ls.c,v 1.9 1995/10/26 10:56:38 ache Exp $ */ #ifndef lint @@ -95,6 +95,8 @@ int f_dirname; /* if precede with directory name */ int f_timesort; /* sort by time vice name */ int f_type; /* add type character for non-regular files */ +int rval; + int main(argc, argv) int argc; @@ -271,7 +273,7 @@ main(argc, argv) traverse(argc, argv, fts_options); else traverse(1, dotav, fts_options); - exit(0); + exit(rval); } static int output; /* If anything output. */ @@ -313,6 +315,7 @@ traverse(argc, argv, options) case FTS_DNR: case FTS_ERR: warnx("%s: %s", p->fts_name, strerror(p->fts_errno)); + rval = 1; break; case FTS_D: if (p->fts_level != FTS_ROOTLEVEL && @@ -383,6 +386,7 @@ display(p, list) warnx("%s: %s", cur->fts_name, strerror(cur->fts_errno)); cur->fts_number = NO_PRINT; + rval = 1; continue; } -- cgit v1.1