X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flockfile.c;h=031906298e9ffaa3a51075b6fe8c487f6d2c2f46;hb=7e5c1daf8cff3a0d6a4a81b56bf4cc4f32d25513;hp=d94b196a341667864073e62f4f142c8556bc0ba5;hpb=9c78378bebc1a9f3d400f422df8ede9efea57dea;p=util-vserver.git diff --git a/src/lockfile.c b/src/lockfile.c index d94b196..0319062 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" @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) if ((sync_fd=open(argv[idx+1], O_WRONLY))==-1) perror("lockfile: open()"); - else if ((fd=open(argv[idx], O_CREAT|O_RDONLY|O_NOFOLLOW|O_NONBLOCK, 0644))==-1) + else if ((fd=open(argv[idx], O_CREAT|O_WRONLY|O_NOFOLLOW|O_NONBLOCK, 0644))==-1) perror("lockfile: open()"); else if (unlink(argv[idx+1])==-1) perror("lockfile: unlink()"); @@ -122,10 +122,10 @@ int main(int argc, char *argv[]) else while (time(0)