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
This commit is contained in:
Pedro F. Giffuni 2014-12-31 16:30:33 +00:00
parent 490341147e
commit f718bedc4f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276472
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}
/*

View File

@ -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);
}