From ecc4a991f39a9b982c50d896d09676012b5d60a2 Mon Sep 17 00:00:00 2001 From: gabor Date: Wed, 7 Dec 2011 12:25:28 +0000 Subject: - Match GNU behavior of exit code - Rename variable that has a different meaning now PR: bin/162930 Submitted by: Jan Beich MFC after: 1 week --- usr.bin/grep/grep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/grep/grep.c') diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 288df90..4eb4727 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -148,7 +148,7 @@ static inline const char *init_color(const char *); bool first = true; /* flag whether we are processing the first match */ bool prev; /* flag whether or not the previous line matched */ int tail; /* lines left to print */ -bool notfound; /* file not found */ +bool file_err; /* file reading error */ /* * Prints usage information and returns 2. @@ -728,5 +728,5 @@ main(int argc, char *argv[]) /* Find out the correct return value according to the results and the command line option. */ - exit(c ? (notfound ? (qflag ? 0 : 2) : 0) : (notfound ? 2 : 1)); + exit(c ? (file_err ? (qflag ? 0 : 2) : 0) : (file_err ? 2 : 1)); } -- cgit v1.1