Put the correct pid in /var/run/tunX.pid

Suggested by: many
This commit is contained in:
Brian Somers 1998-06-06 20:50:57 +00:00
parent 3ed81d03b3
commit da66dd135a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36709
3 changed files with 7 additions and 4 deletions

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bundle.c,v 1.11 1998/05/29 18:32:09 brian Exp $
* $Id: bundle.c,v 1.12 1998/05/29 18:33:08 brian Exp $
*/
#include <sys/param.h>
@ -653,7 +653,7 @@ bundle_DescriptorWrite(struct descriptor *d, struct bundle *bundle,
descriptor_Write(&dl->desc, bundle, fdset);
}
static void
void
bundle_LockTun(struct bundle *bundle)
{
FILE *lockfile;

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bundle.h,v 1.4 1998/05/28 23:17:33 brian Exp $
* $Id: bundle.h,v 1.5 1998/05/29 18:33:08 brian Exp $
*/
#define PHASE_DEAD 0 /* Link is dead */
@ -166,3 +166,4 @@ extern int bundle_SetMode(struct bundle *, struct datalink *, int);
extern int bundle_RenameDatalink(struct bundle *, struct datalink *,
const char *);
extern void bundle_setsid(struct bundle *, int);
extern void bundle_LockTun(struct bundle *);

View File

@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $Id: main.c,v 1.128 1998/05/29 18:32:11 brian Exp $
* $Id: main.c,v 1.129 1998/05/29 18:33:09 brian Exp $
*
* TODO:
*/
@ -408,6 +408,8 @@ main(int argc, char **argv)
bundle->notify.fd = bgpipe[1];
}
bundle_LockTun(bundle); /* we have a new pid */
/* -auto, -dedicated, -ddial & -background */
prompt_Destroy(prompt, 0);
close(STDOUT_FILENO);