aboutsummaryrefslogtreecommitdiff
path: root/miscutils/readahead.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-11-06 03:05:54 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-11-06 03:05:54 +0000
commit6bef3d1d2216234454875052220ca0f477a820b4 (patch)
tree717060345370b781d3d1cde7ab4dd29304a066e8 /miscutils/readahead.c
parent1bec1b980e3cf5ad604fb0c2038a3ab83d9ab5f5 (diff)
downloadbusybox-w32-6bef3d1d2216234454875052220ca0f477a820b4.tar.gz
busybox-w32-6bef3d1d2216234454875052220ca0f477a820b4.tar.bz2
busybox-w32-6bef3d1d2216234454875052220ca0f477a820b4.zip
fbset: fix buglet where we were using wrong pointer
readahead: stop using stdio.h *: style fixes
Diffstat (limited to 'miscutils/readahead.c')
-rw-r--r--miscutils/readahead.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/miscutils/readahead.c b/miscutils/readahead.c
index 647eb3121..7b375cfff 100644
--- a/miscutils/readahead.c
+++ b/miscutils/readahead.c
@@ -15,17 +15,15 @@
15int readahead_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 15int readahead_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
16int readahead_main(int argc, char **argv) 16int readahead_main(int argc, char **argv)
17{ 17{
18 FILE *f;
19 int retval = EXIT_SUCCESS; 18 int retval = EXIT_SUCCESS;
20 19
21 if (argc == 1) bb_show_usage(); 20 if (argc == 1) bb_show_usage();
22 21
23 while (*++argv) { 22 while (*++argv) {
24 if ((f = fopen_or_warn(*argv, "r")) != NULL) { 23 int fd = open_or_warn(*argv, O_RDONLY);
25 int r, fd=fileno(f); 24 if (fd >= 0) {
26 25 int r = readahead(fd, 0, fdlength(fd));
27 r = readahead(fd, 0, fdlength(fd)); 26 close(fd);
28 fclose(f);
29 if (r >= 0) continue; 27 if (r >= 0) continue;
30 } 28 }
31 retval = EXIT_FAILURE; 29 retval = EXIT_FAILURE;