X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flockfile.c;h=eabfe68b0e45cf127467a3cff87369bc64637d4f;hb=4a561cdbf4fcfe7cbc58a236a9ad7bc3c2476bef;hp=d94b196a341667864073e62f4f142c8556bc0ba5;hpb=9c78378bebc1a9f3d400f422df8ede9efea57dea;p=util-vserver.git diff --git a/src/lockfile.c b/src/lockfile.c index d94b196..eabfe68 100644 --- a/src/lockfile.c +++ b/src/lockfile.c @@ -44,7 +44,7 @@ showHelp(char const *cmd) " 2. 'lockfile' will be called\n" " 3a. 'lockfile' waits until somebody opens the for reading\n" " 3b. parent (shell) opens the pipe for reading and blocks\n" - " 4. 'lockfile' calls flock() on the \n" + " 4. 'lockfile' calls lockf() on the \n" " 5. 'lockfile' closes the \n" " 6. parent (shell) unlocks since is closed\n" " 7. 'lockfile' goes into infinite loop\n" @@ -123,9 +123,9 @@ int main(int argc, char *argv[]) int duration = end_time-time(0); alarm(MIN(10, MAX(duration,1))); - if (flock(fd,LOCK_EX)==-1) { + if (lockf(fd,F_LOCK,0)==-1) { if (errno==EINTR) continue; - perror("lockfile: flock()"); + perror("lockfile: lockf()"); break; } signal(SIGALRM, SIG_IGN);