head	1.3;
access;
symbols
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.2
	RELEASE_5_4_0:1.2
	RELEASE_4_11_0:1.2
	RELEASE_5_3_0:1.2
	RELEASE_4_10_0:1.2
	RELEASE_5_2_1:1.2
	RELEASE_5_2_0:1.2
	RELEASE_4_9_0:1.2
	RELEASE_5_1_0:1.2
	RELEASE_4_8_0:1.2
	RELEASE_5_0_0:1.2
	RELEASE_4_7_0:1.2
	RELEASE_4_6_2:1.2
	RELEASE_4_6_1:1.2
	RELEASE_4_6_0:1.2
	RELEASE_5_0_DP1:1.2
	RELEASE_4_5_0:1.2
	RELEASE_4_4_0:1.2
	RELEASE_4_3_0:1.2
	RELEASE_4_2_0:1.1.1.1
	RELEASE_4_1_1:1.1.1.1
	RELEASE_4_1_0:1.1.1.1
	RELEASE_3_5_0:1.1.1.1
	RELEASE_4_0_0:1.1.1.1
	RELEASE_3_4_0:1.1.1.1
	RELEASE_3_3_0:1.1.1.1
	RELEASE_3_2_0:1.1.1.1
	RELEASE_3_1_0:1.1.1.1
	RELEASE_2_2_8:1.1.1.1
	RELEASE_3_0_0:1.1.1.1
	v2_3d:1.1.1.1
	VAUDREY:1.1.1;
locks; strict;
comment	@# @;


1.3
date	2006.05.21.20.39.56;	author pav;	state dead;
branches;
next	1.2;

1.2
date	2001.02.26.05.00.12;	author steve;	state Exp;
branches;
next	1.1;

1.1
date	98.08.09.00.28.23;	author steve;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	98.08.09.00.28.23;	author steve;	state Exp;
branches;
next	;


desc
@@


1.3
log
@- Update to 2.5c2

PR:		ports/96146
Submitted by:	Bernd Luevelsmeyer <bdluevel@@heitec.net> (maintainer)
@
text
@--- 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));
       }
@


1.2
log
@Update to version 2.4d7.

PR:		25222
Submitted by:	Bernd Luevelsmeyer <bdluevel@@heitec.net>
@
text
@@


1.1
log
@Initial revision
@
text
@d1 3
a3 3
--- src/sfl/sflproc.c.orig	Tue Sep 30 02:52:30 1997
+++ src/sfl/sflproc.c	Sun Oct 12 18:39:01 1997
@@@@ -1021,8 +1021,6 @@@@
d9 4
a12 4
 
     /*  We recreate our process as a child of init.  The process continues   */
     /*  to exit in the background.  UNIX calls wait() for all children of    */
@@@@ -1065,17 +1063,21 @@@@
a39 1
 
@


1.1.1.1
log
@Initial import of Xitami version 2.3d.
A fast, portable multithreaded web server.

PR:		4770
Submitted by:	Ian Vaudrey <i.vaudrey@@cableinet.co.uk>
@
text
@@
