Changeset 2678
- Timestamp:
- 02/16/08 23:09:30 (9 months ago)
- Files:
-
- trunk/lib_internal/util-lockfile.c (modified) (1 diff)
- trunk/src/lockfile.c (modified) (2 diffs)
- trunk/src/secure-mount.c (modified) (1 diff)
- trunk/vserver-start/main.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib_internal/util-lockfile.c
r1616 r2678 62 62 } 63 63 64 errstr = " flock()";65 while ( flock(*fd, op)==-1) {64 errstr = "lockf()"; 65 while (lockf(*fd, op, 0)==-1) { 66 66 if ((errno!=EINTR && errno!=EINTR) || alarm_flag) goto err; 67 67 } trunk/src/lockfile.c
r1447 r2678 45 45 " 3a. 'lockfile' waits until somebody opens the <syncpipe> for reading\n" 46 46 " 3b. parent (shell) opens the pipe for reading and blocks\n" 47 " 4. 'lockfile' calls flock() on the <lockfile>\n"47 " 4. 'lockfile' calls lockf() on the <lockfile>\n" 48 48 " 5. 'lockfile' closes the <syncpipe>\n" 49 49 " 6. parent (shell) unlocks since <syncpipe> is closed\n" … … 124 124 alarm(MIN(10, MAX(duration,1))); 125 125 126 if ( flock(fd,LOCK_EX)==-1) {126 if (lockf(fd,F_LOCK,0)==-1) { 127 127 if (errno==EINTR) continue; 128 perror("lockfile: flock()");128 perror("lockfile: lockf()"); 129 129 break; 130 130 } trunk/src/secure-mount.c
r2480 r2678 280 280 } 281 281 282 if ( flock(fd, LOCK_EX)==-1) {283 perror("secure-mount: flock()");282 if (lockf(fd, F_LOCK, 0)==-1) { 283 perror("secure-mount: lockf()"); 284 284 goto err1; 285 285 } trunk/vserver-start/main.c
r2589 r2678 99 99 *ptr = '\0'; 100 100 101 if (!lockfile(&fd, tmp, LOCK_EX, 30, &err)) {101 if (!lockfile(&fd, tmp, F_LOCK, 30, &err)) { 102 102 WRITE_MSG(2, "vserver.start: failed to lock '"); 103 103 WRITE_STR(2, tmp);
