daemon.c (167356) | daemon.c (167357) |
---|---|
1/*- 2 * Copyright (c) 1999 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 15 unchanged lines hidden (view full) --- 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * From BSDI: daemon.c,v 1.2 1996/08/15 01:11:09 jch Exp 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1999 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 15 unchanged lines hidden (view full) --- 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * From BSDI: daemon.c,v 1.2 1996/08/15 01:11:09 jch Exp 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/usr.sbin/daemon/daemon.c 167356 2007-03-09 09:33:19Z trhodes $"); | 32__FBSDID("$FreeBSD: head/usr.sbin/daemon/daemon.c 167357 2007-03-09 09:40:23Z trhodes $"); |
33 34#include <sys/param.h> 35 36#include <err.h> 37#include <errno.h> 38#include <pwd.h> 39#include <grp.h> 40#include <libutil.h> 41#include <stdio.h> 42#include <stdlib.h> 43#include <unistd.h> 44 45static void restrict_process(const char *, const char *); 46static void usage(void); 47 48int 49main(int argc, char *argv[]) 50{ | 33 34#include <sys/param.h> 35 36#include <err.h> 37#include <errno.h> 38#include <pwd.h> 39#include <grp.h> 40#include <libutil.h> 41#include <stdio.h> 42#include <stdlib.h> 43#include <unistd.h> 44 45static void restrict_process(const char *, const char *); 46static void usage(void); 47 48int 49main(int argc, char *argv[]) 50{ |
51 struct pidfh *pfh; | 51 struct pidfh *pfh = NULL; |
52 int ch, nochdir, noclose, errcode; 53 const char *pidfile, *user, *group; 54 pid_t otherpid; 55 56 nochdir = noclose = 1; 57 pidfile = user = group = NULL; 58 while ((ch = getopt(argc, argv, "-cfg:p:u:")) != -1) { 59 switch (ch) { --- 100 unchanged lines hidden --- | 52 int ch, nochdir, noclose, errcode; 53 const char *pidfile, *user, *group; 54 pid_t otherpid; 55 56 nochdir = noclose = 1; 57 pidfile = user = group = NULL; 58 while ((ch = getopt(argc, argv, "-cfg:p:u:")) != -1) { 59 switch (ch) { --- 100 unchanged lines hidden --- |