From: markus schnalke Date: Fri, 2 Oct 2015 17:24:28 +0000 (+0200) Subject: Sleep only 1 sec before retry to lock the file X-Git-Tag: mmh-0.2-RC1~18 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=c6cf5c38fb74a2399cc656357be571f1669a36d1;p=mmh Sleep only 1 sec before retry to lock the file The previous 5 seconds might have been appropriate on old, heavy loaded systems, but they will hardly be necessary on modern ones. --- diff --git a/sbr/lock_file.c b/sbr/lock_file.c index bdce7bb..b62604a 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -330,7 +330,7 @@ lkopen_kernel(char *file, int access, mode_t mode) j = errno; close(fd); - sleep(5); + sleep(1); } close(fd); @@ -382,7 +382,7 @@ lkopen_dot(char *file, int access, mode_t mode) if (stat(lkinfo.curlock, &st) == -1) { if (i++ > 5) return -1; - sleep(5); + sleep(1); } else { time_t curtime; i = 0; @@ -395,7 +395,7 @@ lkopen_dot(char *file, int access, mode_t mode) if (curtime > st.st_ctime + RSECS) unlink(lkinfo.curlock); else - sleep(5); + sleep(1); } lockname(file, &lkinfo, 1); } diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 0ce5425..45451f8 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -44,7 +44,7 @@ mbox_open(char *file, uid_t uid, gid_t gid, mode_t mode) #endif case ETXTBSY: i = errno; - sleep(5); + sleep(1); continue; default: