summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko2020-12-11 16:48:47 +0100
committerDenys Vlasenko2020-12-11 16:48:47 +0100
commit030fe31760169783537162b83af89e551bf120f6 (patch)
tree92b219784b478405626b9259b82900ab3ca72a8e /networking
parent56ee5765074b2f2389066f3234a4da21501d3eaa (diff)
downloadbusybox-030fe31760169783537162b83af89e551bf120f6.zip
busybox-030fe31760169783537162b83af89e551bf120f6.tar.gz
libbb: make msleep() result in only one syscall instead of looping
function old new delta msleep 45 52 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/ifupdown.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 60ceb5a..fedf05a 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -1357,15 +1357,15 @@ static FILE *open_new_state_file(void)
IFSTATE_FILE_PATH".new");
}
/* Someone else created the .new file */
- if (cnt > 30 * 1000) {
+ if (cnt > 30) {
/* Waited for 30*30/2 = 450 milliseconds, still EEXIST.
* Assuming a stale file, rewriting it.
*/
flags = (O_WRONLY | O_CREAT | O_TRUNC);
continue;
}
- usleep(cnt);
- cnt += 1000;
+ msleep(cnt);
+ cnt++;
}
return xfdopen_for_write(fd);