[Toybox] [PATCH] Don't use xfdopen

idunham at lavabit.com idunham at lavabit.com
Sun Aug 4 17:30:00 PDT 2013


grep in hg tip won't build without this patch.
xfdopen is not needed (we already have the file open, and we wouldn't
want to die early if by some peculiar chance that were irrelevant).


diff -r b570b2bfbf7d toys/pending/grep.c
--- a/toys/pending/grep.c	Sun Aug 04 01:22:49 2013 -0500
+++ b/toys/pending/grep.c	Sun Aug 04 17:20:53 2013 -0700
@@ -51,7 +51,7 @@
 
 static void do_grep(int fd, char *name)
 {
-  FILE *file = xfdopen(fd, "r");
+  FILE *file = fdopen(fd, "r");
   long offset = 0;
   int lcount = 0, mcount = 0, which = toys.optflags & FLAG_w ? 2 : 0;
 



 1375662600.0


More information about the Toybox mailing list