| 253 |
int i; |
int i; |
| 254 |
f = open(device, mode|O_EXCL); |
f = open(device, mode|O_EXCL); |
| 255 |
/* try to reopen locked/busy devices up to five times */ |
/* try to reopen locked/busy devices up to five times */ |
| 256 |
for (i = 0; (i < 3) && (f == -1 && errno == EBUSY); i++) { |
for (i = 0; (i < 5) && (f == -1 && errno == EBUSY); i++) { |
| 257 |
fprintf(stderr, "Error trying to open %s exclusively (%s)... %s\n", |
fprintf(stderr, "Error trying to open %s exclusively (%s)... %s\n", |
| 258 |
device, strerror(errno), |
device, strerror(errno), |
| 259 |
(i<4)?"retrying in 1 second.":"giving up."); |
(i<4)?"retrying in 1 second.":"giving up."); |