Fri Dec 31 17:59:24 2010 UTC ()
Don't broadcast unmntall with SIGTERM -- it just makes the atf default
cleanup kill hang for a while.


(pooka)
diff -r1.4 -r1.5 src/tests/fs/nfs/nfsservice/mountd.c

cvs diff -r1.4 -r1.5 src/tests/fs/nfs/nfsservice/Attic/mountd.c (expand / switch to unified diff)

--- src/tests/fs/nfs/nfsservice/Attic/mountd.c 2010/07/28 15:15:22 1.4
+++ src/tests/fs/nfs/nfsservice/Attic/mountd.c 2010/12/31 17:59:24 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mountd.c,v 1.4 2010/07/28 15:15:22 pooka Exp $ */ 1/* $NetBSD: mountd.c,v 1.5 2010/12/31 17:59:24 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1989, 1993 4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Herb Hasler and Rick Macklem at The University of Guelph. 8 * Herb Hasler and Rick Macklem at The University of Guelph.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -32,27 +32,27 @@ @@ -32,27 +32,27 @@
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36#ifndef lint 36#ifndef lint
37__COPYRIGHT("@(#) Copyright (c) 1989, 1993\ 37__COPYRIGHT("@(#) Copyright (c) 1989, 1993\
38 The Regents of the University of California. All rights reserved."); 38 The Regents of the University of California. All rights reserved.");
39#endif /* not lint */ 39#endif /* not lint */
40 40
41#ifndef lint 41#ifndef lint
42#if 0 42#if 0
43static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; 43static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95";
44#else 44#else
45__RCSID("$NetBSD: mountd.c,v 1.4 2010/07/28 15:15:22 pooka Exp $"); 45__RCSID("$NetBSD: mountd.c,v 1.5 2010/12/31 17:59:24 pooka Exp $");
46#endif 46#endif
47#endif /* not lint */ 47#endif /* not lint */
48 48
49#include <sys/param.h> 49#include <sys/param.h>
50#include <sys/file.h> 50#include <sys/file.h>
51#include <sys/ioctl.h> 51#include <sys/ioctl.h>
52#include <sys/mount.h> 52#include <sys/mount.h>
53#include <sys/socket.h> 53#include <sys/socket.h>
54#include <sys/stat.h> 54#include <sys/stat.h>
55#include <syslog.h> 55#include <syslog.h>
56#include <sys/ucred.h> 56#include <sys/ucred.h>
57 57
58#include <rpc/rpc.h> 58#include <rpc/rpc.h>
@@ -200,27 +200,29 @@ static int get_host __P((const char *, s @@ -200,27 +200,29 @@ static int get_host __P((const char *, s
200static struct hostlist *get_ht __P((void)); 200static struct hostlist *get_ht __P((void));
201static void get_mountlist __P((void)); 201static void get_mountlist __P((void));
202static int get_net __P((char *, struct netmsk *, int)); 202static int get_net __P((char *, struct netmsk *, int));
203static void free_exp_grp __P((struct exportlist *, struct grouplist *)); 203static void free_exp_grp __P((struct exportlist *, struct grouplist *));
204static struct grouplist *get_grp __P((void)); 204static struct grouplist *get_grp __P((void));
205static void hang_dirp __P((struct dirlist *, struct grouplist *, 205static void hang_dirp __P((struct dirlist *, struct grouplist *,
206 struct exportlist *, int)); 206 struct exportlist *, int));
207static void mntsrv __P((struct svc_req *, SVCXPRT *)); 207static void mntsrv __P((struct svc_req *, SVCXPRT *));
208static void nextfield __P((char **, char **)); 208static void nextfield __P((char **, char **));
209static void parsecred __P((char *, struct uucred *)); 209static void parsecred __P((char *, struct uucred *));
210static int put_exlist __P((struct dirlist *, XDR *, struct dirlist *, int *)); 210static int put_exlist __P((struct dirlist *, XDR *, struct dirlist *, int *));
211static int scan_tree __P((struct dirlist *, struct sockaddr *)); 211static int scan_tree __P((struct dirlist *, struct sockaddr *));
212static void send_umntall __P((int)); 212static void send_umntall __P((int));
 213#if 0
213static int umntall_each __P((caddr_t, struct sockaddr_in *)); 214static int umntall_each __P((caddr_t, struct sockaddr_in *));
 215#endif
214static int xdr_dir __P((XDR *, char *)); 216static int xdr_dir __P((XDR *, char *));
215static int xdr_explist __P((XDR *, caddr_t)); 217static int xdr_explist __P((XDR *, caddr_t));
216static int xdr_fhs __P((XDR *, caddr_t)); 218static int xdr_fhs __P((XDR *, caddr_t));
217static int xdr_mlist __P((XDR *, caddr_t)); 219static int xdr_mlist __P((XDR *, caddr_t));
218static int bitcmp __P((void *, void *, int)); 220static int bitcmp __P((void *, void *, int));
219static int netpartcmp __P((struct sockaddr *, struct sockaddr *, int)); 221static int netpartcmp __P((struct sockaddr *, struct sockaddr *, int));
220static int sacmp __P((struct sockaddr *, struct sockaddr *)); 222static int sacmp __P((struct sockaddr *, struct sockaddr *));
221static int allones __P((struct sockaddr_storage *, int)); 223static int allones __P((struct sockaddr_storage *, int));
222static int countones __P((struct sockaddr *)); 224static int countones __P((struct sockaddr *));
223static void bind_resv_port __P((int, sa_family_t, in_port_t)); 225static void bind_resv_port __P((int, sa_family_t, in_port_t));
224static void no_nfs(int); 226static void no_nfs(int);
225static struct exportlist *exphead; 227static struct exportlist *exphead;
226static struct mountlist *mlhead; 228static struct mountlist *mlhead;
@@ -2376,38 +2378,42 @@ add_mlist(hostp, dirp, flags) @@ -2376,38 +2378,42 @@ add_mlist(hostp, dirp, flags)
2376 (void)fprintf(mlfile, "%s %s\n", mlp->ml_host, mlp->ml_dirp); 2378 (void)fprintf(mlfile, "%s %s\n", mlp->ml_host, mlp->ml_dirp);
2377 (void)fclose(mlfile); 2379 (void)fclose(mlfile);
2378} 2380}
2379 2381
2380/* 2382/*
2381 * This function is called via. SIGTERM when the system is going down. 2383 * This function is called via. SIGTERM when the system is going down.
2382 * It sends a broadcast RPCMNT_UMNTALL. 2384 * It sends a broadcast RPCMNT_UMNTALL.
2383 */ 2385 */
2384/* ARGSUSED */ 2386/* ARGSUSED */
2385static void 2387static void
2386send_umntall(n) 2388send_umntall(n)
2387 int n; 2389 int n;
2388{ 2390{
 2391#if 0
2389 (void)clnt_broadcast(RPCPROG_MNT, RPCMNT_VER1, RPCMNT_UMNTALL, 2392 (void)clnt_broadcast(RPCPROG_MNT, RPCMNT_VER1, RPCMNT_UMNTALL,
2390 xdr_void, NULL, xdr_void, NULL, (resultproc_t)umntall_each); 2393 xdr_void, NULL, xdr_void, NULL, (resultproc_t)umntall_each);
 2394#endif
2391 exit(0); 2395 exit(0);
2392} 2396}
2393 2397
 2398#if 0
2394static int 2399static int
2395umntall_each(resultsp, raddr) 2400umntall_each(resultsp, raddr)
2396 caddr_t resultsp; 2401 caddr_t resultsp;
2397 struct sockaddr_in *raddr; 2402 struct sockaddr_in *raddr;
2398{ 2403{
2399 return (1); 2404 return (1);
2400} 2405}
 2406#endif
2401 2407
2402/* 2408/*
2403 * Free up a group list. 2409 * Free up a group list.
2404 */ 2410 */
2405static void 2411static void
2406free_grp(grp) 2412free_grp(grp)
2407 struct grouplist *grp; 2413 struct grouplist *grp;
2408{ 2414{
2409 2415
2410 if (grp->gr_type == GT_HOST) { 2416 if (grp->gr_type == GT_HOST) {
2411 if (grp->gr_ptr.gt_addrinfo != NULL) 2417 if (grp->gr_ptr.gt_addrinfo != NULL)
2412 freeaddrinfo(grp->gr_ptr.gt_addrinfo); 2418 freeaddrinfo(grp->gr_ptr.gt_addrinfo);
2413 } else if (grp->gr_type == GT_NET) { 2419 } else if (grp->gr_type == GT_NET) {