summaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
Diffstat (limited to 'findutils')
-rw-r--r--findutils/grep.c4
-rw-r--r--findutils/xargs.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 5cfd772..030e624 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -375,7 +375,7 @@ static int FAST_FUNC file_action_grep(const char *filename,
void* matched,
int depth UNUSED_PARAM)
{
- FILE *file = fopen(filename, "r");
+ FILE *file = fopen_for_read(filename);
if (file == NULL) {
if (!SUPPRESS_ERR_MSGS)
bb_simple_perror_msg(filename);
@@ -514,7 +514,7 @@ int grep_main(int argc, char **argv)
}
}
/* else: fopen(dir) will succeed, but reading won't */
- file = fopen(cur_file, "r");
+ file = fopen_for_read(cur_file);
if (file == NULL) {
if (!SUPPRESS_ERR_MSGS)
bb_simple_perror_msg(cur_file);
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 7a9865b..8f0a3d4 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -277,7 +277,7 @@ static int xargs_ask_confirmation(void)
FILE *tty_stream;
int c, savec;
- tty_stream = xfopen(CURRENT_TTY, "r");
+ tty_stream = xfopen_for_read(CURRENT_TTY);
fputs(" ?...", stderr);
fflush(stderr);
c = savec = getc(tty_stream);