aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--findutils/grep.c6
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}