Use pidfile(3).
This commit is contained in:
parent
bcd4659148
commit
2e2748128a
|
@ -1,7 +1,10 @@
|
|||
# $NetBSD: Makefile,v 1.6 1997/03/12 18:50:06 mycroft Exp $
|
||||
# $NetBSD: Makefile,v 1.7 1999/06/06 03:39:11 thorpej Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/6/93
|
||||
|
||||
PROG= update
|
||||
MAN= update.8
|
||||
|
||||
LDADD+= -lutil
|
||||
DPADD+= ${LIBUTIL}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* $NetBSD: update.c,v 1.7 1999/06/06 03:39:11 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1987, 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
|
@ -41,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1990, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)update.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: update.c,v 1.6 1997/10/17 13:59:42 lukem Exp $");
|
||||
__RCSID("$NetBSD: update.c,v 1.7 1999/06/06 03:39:11 thorpej Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -52,6 +54,7 @@ __RCSID("$NetBSD: update.c,v 1.6 1997/10/17 13:59:42 lukem Exp $");
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <util.h>
|
||||
|
||||
int main __P((int, char **));
|
||||
void mysync __P((int));
|
||||
|
@ -90,6 +93,7 @@ main(argc, argv)
|
|||
usage();
|
||||
|
||||
daemon(0, 0);
|
||||
pidfile(NULL);
|
||||
|
||||
sa.sa_handler = mysync;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# $NetBSD: Makefile,v 1.2 1998/07/12 20:40:44 augustss Exp $
|
||||
# $NetBSD: Makefile,v 1.3 1999/06/06 03:40:27 thorpej Exp $
|
||||
|
||||
PROG= usbd
|
||||
MAN= usbd.8
|
||||
|
||||
LDADD+= -lutil
|
||||
DPADD+= ${LIBUTIL}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <bsd.subdir.mk>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: usbd.c,v 1.4 1998/12/09 00:57:19 augustss Exp $ */
|
||||
/* $NetBSD: usbd.c,v 1.5 1999/06/06 03:40:27 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -43,6 +43,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <util.h>
|
||||
#include <sys/time.h>
|
||||
#include <dev/usb/usb.h>
|
||||
|
||||
|
@ -153,8 +154,10 @@ main(int argc, char **argv)
|
|||
exit(0);
|
||||
}
|
||||
|
||||
if (!debug)
|
||||
if (!debug) {
|
||||
daemon(0, 0);
|
||||
pidfile(NULL);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
FD_ZERO(&fdset);
|
||||
|
|
Loading…
Reference in New Issue