Author: pfg
Date: Wed Dec 31 16:30:33 2014
New Revision: 276472
URL: https://svnweb.freebsd.org/changeset/base/276472

Log:
  Fixes to exit status.
  
  Exit with EXIT_FAILURE for invalid arguments.
  Fixes NetBSD-PR 43517.
  
  Print version string to stdout instead of stderr;
  it is user-requested and not an error.
  
  Obtained from:        NetBSD
  MFC after:    5 days

Modified:
  head/usr.bin/patch/patch.c
  head/usr.bin/patch/util.c

Modified: head/usr.bin/patch/patch.c
==============================================================================
--- head/usr.bin/patch/patch.c  Wed Dec 31 16:28:16 2014        (r276471)
+++ head/usr.bin/patch/patch.c  Wed Dec 31 16:30:33 2014        (r276472)
@@ -634,7 +634,7 @@ usage(void)
 "             [-r rej-name] [-V t | nil | never] [-x number] [-z backup-ext]\n"
 "             [--posix] [origfile [patchfile]]\n"
 "       patch <patchfile\n");
-       my_exit(EXIT_SUCCESS);
+       my_exit(EXIT_FAILURE);
 }
 
 /*

Modified: head/usr.bin/patch/util.c
==============================================================================
--- head/usr.bin/patch/util.c   Wed Dec 31 16:28:16 2014        (r276471)
+++ head/usr.bin/patch/util.c   Wed Dec 31 16:30:33 2014        (r276472)
@@ -428,7 +428,7 @@ checked_in(char *file)
 void
 version(void)
 {
-       fprintf(stderr, "patch 2.0-12u10 FreeBSD\n");
+       printf("patch 2.0-12u10 FreeBSD\n");
        my_exit(EXIT_SUCCESS);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to