OSDN Git Service

Make xopen() skip stdin/stdout/stderr, add xopen_stdio() if you want stdout,
[android-x86/external-toybox.git] / toys / other / shred.c
index 5b018ea..30b5e7d 100644 (file)
@@ -42,7 +42,7 @@ void shred_main(void)
   char **try;
 
   if (!(toys.optflags & FLAG_n)) TT.iterations++;
-  TT.ufd = xopen("/dev/urandom", O_RDONLY);
+  TT.ufd = xopenro("/dev/urandom");
 
   // We don't use loopfiles() here because "-" isn't stdin, and want to
   // respond to files we can't open via chmod.