Sleep only 1 sec before retry to lock the file
authormarkus schnalke <meillo@marmaro.de>
Fri, 2 Oct 2015 17:24:28 +0000 (19:24 +0200)
committermarkus schnalke <meillo@marmaro.de>
Fri, 2 Oct 2015 17:24:28 +0000 (19:24 +0200)
The previous 5 seconds might have been appropriate on old, heavy
loaded systems, but they will hardly be necessary on modern ones.

sbr/lock_file.c
uip/dropsbr.c

index bdce7bb..b62604a 100644 (file)
@@ -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);
                        }
index 0ce5425..45451f8 100644 (file)
@@ -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: