From 6bef3d1d2216234454875052220ca0f477a820b4 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 6 Nov 2007 03:05:54 +0000 Subject: fbset: fix buglet where we were using wrong pointer readahead: stop using stdio.h *: style fixes --- libbb/device_open.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libbb/device_open.c') 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 @@ /* try to open up the specified device */ int device_open(const char *device, int mode) { - int m, f, fd = -1; + int m, f, fd; m = mode | O_NONBLOCK; /* Retry up to 5 times */ /* TODO: explain why it can't be considered insane */ - for (f = 0; f < 5; f++) - if ((fd = open(device, m, 0600)) >= 0) + for (f = 0; f < 5; f++) { + fd = open(device, m, 0600); + if (fd >= 0) break; + } if (fd < 0) return fd; /* Reset original flags. */ -- cgit v1.2.3