Hi,

just saw that cat's *main* function does never return even though there is a 
return value,
exit(3) is called instead.
Is there any reason why or is it just historically, cause it's a bit confusing?
If exit(3) is always called, than why not changing the return value to *void*?

Other calls in *src/bin/* share the same behavior.

Regards,
--F.

Index: cat.c
===================================================================
RCS file: /cvs/src/bin/cat/cat.c,v
retrieving revision 1.21
diff -u -p -r1.21 cat.c
--- cat.c       16 Jan 2015 06:39:28 -0000      1.21
+++ cat.c       29 Aug 2015 22:01:35 -0000
@@ -103,8 +103,7 @@ main(int argc, char *argv[])
                raw_args(argv);
        if (fclose(stdout))
                err(1, "stdout");
-       exit(rval);
-       /* NOTREACHED */
+       return (rval);
 }
 
 void

Reply via email to