OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
24b1cc8
)
Provide error messages for files we can open but not read (ala directories).
author
Rob Landley
<rob@landley.net>
Sun, 11 Jun 2017 17:23:00 +0000
(12:23 -0500)
committer
Rob Landley
<rob@landley.net>
Sun, 11 Jun 2017 17:23:00 +0000
(12:23 -0500)
toys/posix/grep.c
patch
|
blob
|
history
diff --git
a/toys/posix/grep.c
b/toys/posix/grep.c
index
c7b44e5
..
891f760
100644
(file)
--- a/
toys/posix/grep.c
+++ b/
toys/posix/grep.c
@@
-102,7
+102,10
@@
static void do_grep(int fd, char *name)
int mmatch = 0;
lcount++;
- if (0 > (len = getdelim(&line, &unused, TT.indelim, file))) break;
+ errno = 0;
+ len = getdelim(&line, &unused, TT.indelim, file);
+ if (errno) perror_msg("%s", name);
+ if (len<1) break;
if (line[len-1] == TT.indelim) line[len-1] = 0;
start = line;