Deleted Added
full compact
kern.c (158921) kern.c (158968)
1/*-
2 * Copyright (c) 1997 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 kern.c,v 1.2 1998/11/25 22:38:27 don Exp
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997 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 kern.c,v 1.2 1998/11/25 22:38:27 don Exp
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/usr.sbin/rpc.lockd/kern.c 158921 2006-05-25 22:12:05Z rodrigc $");
32__FBSDID("$FreeBSD: head/usr.sbin/rpc.lockd/kern.c 158968 2006-05-27 02:37:37Z rodrigc $");
33
34#include <sys/param.h>
35#include <sys/mount.h>
36#include <sys/queue.h>
37#include <sys/socket.h>
38#include <sys/stat.h>
39
40#include <netinet/in.h>

--- 90 unchanged lines hidden (view full) ---

131 struct passwd *pw;
132
133 /* Open the dev . */
134 devfd = open(_PATH_DEV _PATH_NFSLCKDEV, O_RDWR | O_NONBLOCK);
135 if (devfd < 0) {
136 syslog(LOG_ERR, "open: %s: %m", _PATH_NFSLCKDEV);
137 goto err;
138 }
33
34#include <sys/param.h>
35#include <sys/mount.h>
36#include <sys/queue.h>
37#include <sys/socket.h>
38#include <sys/stat.h>
39
40#include <netinet/in.h>

--- 90 unchanged lines hidden (view full) ---

131 struct passwd *pw;
132
133 /* Open the dev . */
134 devfd = open(_PATH_DEV _PATH_NFSLCKDEV, O_RDWR | O_NONBLOCK);
135 if (devfd < 0) {
136 syslog(LOG_ERR, "open: %s: %m", _PATH_NFSLCKDEV);
137 goto err;
138 }
139
140 signal(SIGPIPE, SIG_IGN);
141
139 /*
140 * Create a separate process, the client code is really a separate
141 * daemon that shares a lot of code.
142 */
143 switch (child = fork()) {
144 case -1:
145 err(1, "fork");
146 case 0:
147 break;
148 default:
149 return (child);
150 }
151
152 signal(SIGHUP, (sig_t)client_cleanup);
153 signal(SIGTERM, (sig_t)client_cleanup);
142 /*
143 * Create a separate process, the client code is really a separate
144 * daemon that shares a lot of code.
145 */
146 switch (child = fork()) {
147 case -1:
148 err(1, "fork");
149 case 0:
150 break;
151 default:
152 return (child);
153 }
154
155 signal(SIGHUP, (sig_t)client_cleanup);
156 signal(SIGTERM, (sig_t)client_cleanup);
154 signal(SIGPIPE, SIG_IGN);
155
156 /* Setup. */
157 (void)time(&owner.tod);
158 owner.pid = getpid();
159 (void)gethostname(hostname, sizeof(hostname) - 1);
160
161 pw = getpwnam(DAEMON_USERNAME);
162 if (pw == NULL) {

--- 440 unchanged lines hidden ---
157
158 /* Setup. */
159 (void)time(&owner.tod);
160 owner.pid = getpid();
161 (void)gethostname(hostname, sizeof(hostname) - 1);
162
163 pw = getpwnam(DAEMON_USERNAME);
164 if (pw == NULL) {

--- 440 unchanged lines hidden ---