aboutsummaryrefslogtreecommitdiff
path: root/libbb/device_open.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 /libbb/device_open.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 'libbb/device_open.c')
-rw-r--r--libbb/device_open.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/device_open.c b/libbb/device_open.c
index 2b35ad8a3..6907e9814 100644
--- a/libbb/device_open.c
+++ b/libbb/device_open.c
@@ -12,15 +12,17 @@
12/* try to open up the specified device */ 12/* try to open up the specified device */
13int device_open(const char *device, int mode) 13int device_open(const char *device, int mode)
14{ 14{
15 int m, f, fd = -1; 15 int m, f, fd;
16 16
17 m = mode | O_NONBLOCK; 17 m = mode | O_NONBLOCK;
18 18
19 /* Retry up to 5 times */ 19 /* Retry up to 5 times */
20 /* TODO: explain why it can't be considered insane */ 20 /* TODO: explain why it can't be considered insane */
21 for (f = 0; f < 5; f++) 21 for (f = 0; f < 5; f++) {
22 if ((fd = open(device, m, 0600)) >= 0) 22 fd = open(device, m, 0600);
23 if (fd >= 0)
23 break; 24 break;
25 }
24 if (fd < 0) 26 if (fd < 0)
25 return fd; 27 return fd;
26 /* Reset original flags. */ 28 /* Reset original flags. */