Actually, daemonize the file servers before mounting. I might require

at some point that the local protocol handler does not change after
the file system has been mounted.
This commit is contained in:
pooka 2007-11-05 17:54:31 +00:00
parent 4b0f2948e2
commit ec865a5b29
8 changed files with 37 additions and 43 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtfs.c,v 1.36 2007/11/05 17:48:18 pooka Exp $ */
/* $NetBSD: dtfs.c,v 1.37 2007/11/05 17:54:31 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -254,15 +254,14 @@ main(int argc, char *argv[])
if (maxreqsize != MAXREQMAGIC)
puffs_setmaxreqlen(pu, maxreqsize);
if (puffs_mount(pu, argv[1], mntflags, puffs_getroot(pu)) == -1)
err(1, "mount");
if (detach)
if (daemon(1, 1) == -1)
err(1, "daemon");
if (puffs_mount(pu, argv[1], mntflags, puffs_getroot(pu)) == -1)
err(1, "mount");
if (puffs_mainloop(pu) == -1)
return 1;
err(1, "mainloop");
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: icfs.c,v 1.6 2007/11/05 17:48:18 pooka Exp $ */
/* $NetBSD: icfs.c,v 1.7 2007/11/05 17:54:31 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -212,15 +212,14 @@ main(int argc, char *argv[])
puffs_set_pathcmp(pu, icpathcmp);
puffs_set_pathtransform(pu, icpathxform);
if (puffs_mount(pu, argv[1], mntflags, pn_root) == -1)
err(1, "puffs_mount");
if (detach)
if (daemon(1, 1) == -1)
err(1, "daemon");
if (puffs_mount(pu, argv[1], mntflags, pn_root) == -1)
err(1, "puffs_mount");
if (puffs_mainloop(pu) == -1)
return 1;
err(1, "mainloop");
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pnullfs.c,v 1.14 2007/11/05 17:48:18 pooka Exp $ */
/* $NetBSD: pnullfs.c,v 1.15 2007/11/05 17:54:31 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -111,15 +111,14 @@ main(int argc, char *argv[])
po_root->po_len = strlen(argv[0]);
puffs_stat2vattr(&pn_root->pn_va, &sb);
if (puffs_mount(pu, argv[1], mntflags, pn_root) == -1)
err(1, "puffs_mount");
if (detach)
if (daemon(1, 1) == -1)
err(1, "daemon");
if (puffs_mount(pu, argv[1], mntflags, pn_root) == -1)
err(1, "puffs_mount");
if (puffs_mainloop(pu) == -1)
return 1;
err(1, "mainloop");
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rot13fs.c,v 1.13 2007/11/05 17:48:18 pooka Exp $ */
/* $NetBSD: rot13fs.c,v 1.14 2007/11/05 17:54:31 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -176,15 +176,14 @@ main(int argc, char *argv[])
for (i = 0; i < 26; i++)
tbl[i + 'A'] = 'A' + ((i + 13) % 26);
if (puffs_mount(pu, argv[1], mntflags, pn_root) == -1)
err(1, "puffs_mount");
if (detach)
if (daemon(1, 1) == -1)
err(1, "daemon");
if (puffs_mount(pu, argv[1], mntflags, pn_root) == -1)
err(1, "puffs_mount");
if (puffs_mainloop(pu) == -1)
return 1;
err(1, "mainloop");
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ninepuffs.c,v 1.19 2007/11/05 17:48:18 pooka Exp $ */
/* $NetBSD: ninepuffs.c,v 1.20 2007/11/05 17:54:32 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: ninepuffs.c,v 1.19 2007/11/05 17:48:18 pooka Exp $");
__RCSID("$NetBSD: ninepuffs.c,v 1.20 2007/11/05 17:54:32 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@ -218,15 +218,14 @@ main(int argc, char *argv[])
PUFFS_FBIO_READ | PUFFS_FBIO_WRITE) == -1)
err(1, "puffs_framebuf_addfd");
if (puffs_mount(pu, argv[1], mntflags, pn_root) == -1)
err(1, "puffs_mount");
if (detach)
if (daemon(1, 1) == -1)
err(1, "daemon");
if (puffs_mount(pu, argv[1], mntflags, pn_root) == -1)
err(1, "puffs_mount");
if (puffs_mainloop(pu) == -1)
return 1;
err(1, "mainloop");
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_portal.c,v 1.12 2007/11/05 17:48:19 pooka Exp $ */
/* $NetBSD: puffs_portal.c,v 1.13 2007/11/05 17:54:32 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: puffs_portal.c,v 1.12 2007/11/05 17:48:19 pooka Exp $");
__RCSID("$NetBSD: puffs_portal.c,v 1.13 2007/11/05 17:54:32 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@ -446,15 +446,15 @@ main(int argc, char *argv[])
puffs_ml_setloopfn(pu, portal_loopfn);
puffs_framev_init(pu, portal_frame_rf, portal_frame_wf, NULL,NULL,NULL);
if (puffs_mount(pu, argv[1], mntflags, PORTAL_ROOT) == -1)
err(1, "mount");
if (detach)
if (daemon(1, 1) == -1)
err(1, "daemon");
if (puffs_mount(pu, argv[1], mntflags, PORTAL_ROOT) == -1)
err(1, "mount");
if (puffs_mainloop(pu) == -1)
return 1;
err(1, "mainloop");
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: psshfs.c,v 1.37 2007/11/05 17:48:19 pooka Exp $ */
/* $NetBSD: psshfs.c,v 1.38 2007/11/05 17:54:32 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: psshfs.c,v 1.37 2007/11/05 17:48:19 pooka Exp $");
__RCSID("$NetBSD: psshfs.c,v 1.38 2007/11/05 17:54:32 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@ -218,15 +218,15 @@ main(int argc, char *argv[])
PUFFS_FBIO_READ | PUFFS_FBIO_WRITE) == -1)
err(1, "framebuf addfd");
if (puffs_mount(pu, argv[1], mntflags, puffs_getroot(pu)) == -1)
err(1, "puffs_mount");
if (detach)
if (daemon(1, 1) == -1)
err(1, "daemon");
if (puffs_mount(pu, argv[1], mntflags, puffs_getroot(pu)) == -1)
err(1, "puffs_mount");
if (puffs_mainloop(pu) == -1)
return 1;
err(1, "mainloop");
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysctlfs.c,v 1.4 2007/11/05 17:48:19 pooka Exp $ */
/* $NetBSD: sysctlfs.c,v 1.5 2007/11/05 17:54:32 pooka Exp $ */
/*
* Copyright (c) 2006, 2007 Antti Kantee. All Rights Reserved.
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: sysctlfs.c,v 1.4 2007/11/05 17:48:19 pooka Exp $");
__RCSID("$NetBSD: sysctlfs.c,v 1.5 2007/11/05 17:54:32 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@ -284,15 +284,14 @@ main(int argc, char *argv[])
if (sysctlfs_domount(pu) != 0)
errx(1, "domount");
if (puffs_mount(pu, argv[1], mntflags, puffs_getroot(pu)) == -1)
err(1, "puffs_mount");
if (detach)
if (daemon(1, 1) == -1)
err(1, "daemon");
if (puffs_mount(pu, argv[1], mntflags, puffs_getroot(pu)) == -1)
err(1, "puffs_mount");
if (puffs_mainloop(pu) == -1)
return 1;
err(1, "mainloop");
return 0;
}