Deleted Added
full compact
lockd.c (94404) lockd.c (109363)
1/* $NetBSD: lockd.c,v 1.7 2000/08/12 18:08:44 thorpej Exp $ */
1/* $NetBSD: lockd.c,v 1.7 2000/08/12 18:08:44 thorpej Exp $ */
2/* $FreeBSD: head/usr.sbin/rpc.lockd/lockd.c 94404 2002-04-11 07:19:30Z alfred $ */
2/* $FreeBSD: head/usr.sbin/rpc.lockd/lockd.c 109363 2003-01-16 07:27:30Z mbr $ */
3
4/*
5 * Copyright (c) 1995
6 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:

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

56#include <syslog.h>
57#include <signal.h>
58#include <string.h>
59#include <unistd.h>
60#include <libutil.h>
61#include <netconfig.h>
62
63#include <rpc/rpc.h>
3
4/*
5 * Copyright (c) 1995
6 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:

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

56#include <syslog.h>
57#include <signal.h>
58#include <string.h>
59#include <unistd.h>
60#include <libutil.h>
61#include <netconfig.h>
62
63#include <rpc/rpc.h>
64#include <rpc/rpc_com.h>
64#include <rpcsvc/sm_inter.h>
65
66#include "lockd.h"
67#include <rpcsvc/nlm_prot.h>
68
69int debug_level = 0; /* 0 = no debugging syslog() calls */
70int _rpcsvcdirty = 0;
71

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

90 int argc;
91 char **argv;
92{
93 SVCXPRT *transp;
94 int ch, i, maxindex, s;
95 struct sigaction sigalarm;
96 int grace_period = 30;
97 struct netconfig *nconf;
65#include <rpcsvc/sm_inter.h>
66
67#include "lockd.h"
68#include <rpcsvc/nlm_prot.h>
69
70int debug_level = 0; /* 0 = no debugging syslog() calls */
71int _rpcsvcdirty = 0;
72

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

91 int argc;
92 char **argv;
93{
94 SVCXPRT *transp;
95 int ch, i, maxindex, s;
96 struct sigaction sigalarm;
97 int grace_period = 30;
98 struct netconfig *nconf;
99 int maxrec = RPC_MAXDATASIZE;
98
99 while ((ch = getopt(argc, argv, "d:g:")) != (-1)) {
100 switch (ch) {
101 case 'd':
102 debug_level = atoi(optarg);
103 if (!debug_level) {
104 usage();
105 /* NOTREACHED */

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

134 s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
135 if (s < 0)
136 maxindex = 2;
137 else {
138 close(s);
139 maxindex = 4;
140 }
141
100
101 while ((ch = getopt(argc, argv, "d:g:")) != (-1)) {
102 switch (ch) {
103 case 'd':
104 debug_level = atoi(optarg);
105 if (!debug_level) {
106 usage();
107 /* NOTREACHED */

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

136 s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
137 if (s < 0)
138 maxindex = 2;
139 else {
140 close(s);
141 maxindex = 4;
142 }
143
144 rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec);
145
142 for (i = 0; i < maxindex; i++) {
143 nconf = getnetconfigent(transports[i]);
144 if (nconf == NULL)
145 errx(1, "cannot get %s netconf: %s.", transports[i],
146 nc_sperror());
147
146 for (i = 0; i < maxindex; i++) {
147 nconf = getnetconfigent(transports[i]);
148 if (nconf == NULL)
149 errx(1, "cannot get %s netconf: %s.", transports[i],
150 nc_sperror());
151
148 transp = svc_tli_create(RPC_ANYFD, nconf, NULL, 0, 0);
152 transp = svc_tli_create(RPC_ANYFD, nconf, NULL,
153 RPC_MAXDATASIZE, RPC_MAXDATASIZE);
149 if (transp == NULL) {
150 errx(1, "cannot create %s service.", transports[i]);
151 /* NOTREACHED */
152 }
153 if (!svc_reg(transp, NLM_PROG, NLM_SM, nlm_prog_0, nconf)) {
154 errx(1, "unable to register (NLM_PROG, NLM_SM, %s)",
155 transports[i]);
156 /* NOTREACHED */

--- 115 unchanged lines hidden ---
154 if (transp == NULL) {
155 errx(1, "cannot create %s service.", transports[i]);
156 /* NOTREACHED */
157 }
158 if (!svc_reg(transp, NLM_PROG, NLM_SM, nlm_prog_0, nconf)) {
159 errx(1, "unable to register (NLM_PROG, NLM_SM, %s)",
160 transports[i]);
161 /* NOTREACHED */

--- 115 unchanged lines hidden ---