diff options
Diffstat (limited to 'www/xitami/files/patch-ac')
| -rw-r--r-- | www/xitami/files/patch-ac | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/www/xitami/files/patch-ac b/www/xitami/files/patch-ac deleted file mode 100644 index cf30ef326524..000000000000 --- a/www/xitami/files/patch-ac +++ /dev/null @@ -1,39 +0,0 @@ ---- src/sfl/.vimbk/sflproc.c.vimbk Sat Apr 1 18:11:24 2000 -+++ src/sfl/sflproc.c Tue Nov 7 11:29:34 2000 -@@ -1711,8 +1711,6 @@ - file_handle; - char - pid_buffer [10]; -- struct flock -- lock_file; /* flock() argument block */ - #endif - int - argi = 0, /* Input arguments iterator */ -@@ -1787,17 +1785,21 @@ - - if (lockfile && strused (lockfile)) - { -- file_handle = open (lockfile, O_RDWR | O_CREAT, 0640); -- if (file_handle < 0) -+ if ((file_handle = (open (lockfile, O_RDONLY | O_CREAT, 0640))) == -1) - return (-1); /* We could not open lock file */ -- else -+ if (flock(file_handle, LOCK_EX | LOCK_NB) == -1 && errno == EWOULDBLOCK) - { -- lock_file.l_type = F_WRLCK; -- if (fcntl (file_handle, F_SETLK, &lock_file)) -- return (-1); /* We could not obtain a lock */ -+ close (file_handle); -+ return (-1); /* The file is already locked */ - } -+ close (file_handle); -+ -+ if ((file_handle = (open (lockfile, O_RDWR | O_TRUNC, 0640))) == -1) -+ return (-1); /* We could not open lock file */ -+ if (flock(file_handle, LOCK_EX | LOCK_NB) == -1) -+ return (-1); /* We could not obtain a lock */ - /* We record the server's process id in the lock file */ -- sprintf (pid_buffer, "%6d\n", getpid ()); -+ sprintf (pid_buffer, "%ld\n", (long)getpid ()); - write (file_handle, pid_buffer, strlen (pid_buffer)); - } |
