Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/libbb/device_open.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/libbb/device_open.c
r1765 r2725 5 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 6 6 * 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.7 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 8 8 */ 9 9 … … 11 11 12 12 /* try to open up the specified device */ 13 int device_open(const char *device, int mode)13 int FAST_FUNC device_open(const char *device, int mode) 14 14 { 15 int m, f, fd = -1;15 int m, f, fd; 16 16 17 17 m = mode | O_NONBLOCK; … … 19 19 /* Retry up to 5 times */ 20 20 /* TODO: explain why it can't be considered insane */ 21 for (f = 0; f < 5; f++) 22 if ((fd = open(device, m, 0600)) >= 0) 21 for (f = 0; f < 5; f++) { 22 fd = open(device, m, 0600); 23 if (fd >= 0) 23 24 break; 25 } 24 26 if (fd < 0) 25 27 return fd;
Note:
See TracChangeset
for help on using the changeset viewer.