diff options
author | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-09-23 13:44:03 +0000 |
---|---|---|
committer | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-09-23 13:44:03 +0000 |
commit | a678c1c82698de16fd5dd67a4ae4913b556b6c93 (patch) | |
tree | 5a7a9c97649bbeb5fe091315eaf45eb7a6504ba7 /findutils | |
parent | c388ae879c15cdfc4dd83c9a7d63ec28c0f9f9a1 (diff) | |
download | busybox-w32-a678c1c82698de16fd5dd67a4ae4913b556b6c93.tar.gz busybox-w32-a678c1c82698de16fd5dd67a4ae4913b556b6c93.tar.bz2 busybox-w32-a678c1c82698de16fd5dd67a4ae4913b556b6c93.zip |
SUSv3 -q compatibily exit status correction for grep
git-svn-id: svn://busybox.net/trunk/busybox@11592 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'findutils')
-rw-r--r-- | findutils/grep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/findutils/grep.c b/findutils/grep.c index c3feb2018..986804553 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
@@ -376,7 +376,7 @@ extern int grep_main(int argc, char **argv) | |||
376 | if (file == NULL) { | 376 | if (file == NULL) { |
377 | if (!suppress_err_msgs) | 377 | if (!suppress_err_msgs) |
378 | bb_perror_msg("%s", cur_file); | 378 | bb_perror_msg("%s", cur_file); |
379 | error_open_count++; | 379 | error_open_count++; |
380 | } else { | 380 | } else { |
381 | matched += grep_file(file); | 381 | matched += grep_file(file); |
382 | if(matched < 0) { | 382 | if(matched < 0) { |
@@ -398,7 +398,7 @@ extern int grep_main(int argc, char **argv) | |||
398 | } | 398 | } |
399 | #endif | 399 | #endif |
400 | 400 | ||
401 | if(error_open_count) | 401 | if(be_quiet) |
402 | return 2; | 402 | return error_open_count ? 2 : 0; |
403 | return !matched; /* invert return value 0 = success, 1 = failed */ | 403 | return !matched; /* invert return value 0 = success, 1 = failed */ |
404 | } | 404 | } |