svn commit: r276706 - stable/10/usr.bin/patch

Pedro F. Giffuni pfg at FreeBSD.org
Mon Jan 5 16:09:53 UTC 2015


Author: pfg
Date: Mon Jan  5 16:09:51 2015
New Revision: 276706
URL: https://svnweb.freebsd.org/changeset/base/276706

Log:
  MFC	r276472:
  
  Minor 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

Modified:
  stable/10/usr.bin/patch/patch.c
  stable/10/usr.bin/patch/util.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/patch/patch.c
==============================================================================
--- stable/10/usr.bin/patch/patch.c	Mon Jan  5 16:05:15 2015	(r276705)
+++ stable/10/usr.bin/patch/patch.c	Mon Jan  5 16:09:51 2015	(r276706)
@@ -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: stable/10/usr.bin/patch/util.c
==============================================================================
--- stable/10/usr.bin/patch/util.c	Mon Jan  5 16:05:15 2015	(r276705)
+++ stable/10/usr.bin/patch/util.c	Mon Jan  5 16:09:51 2015	(r276706)
@@ -412,7 +412,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);
 }
 


More information about the svn-src-stable-10 mailing list