X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fmountd.c;h=4df7083e1815efd11d99b026d1e88ae5082b220b;hp=1cfdc7463c7344d8d6994de4b25c9397227f85d7;hb=df07daea1421c80ecf308a6daf3ab3fa7d4cfd65;hpb=553ba8456a0303021564d7ad5640e8cb7ce7c7a7 diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c index 1cfdc74..4df7083 100644 --- a/utils/mountd/mountd.c +++ b/utils/mountd/mountd.c @@ -36,6 +36,7 @@ static struct option longopts[] = { "no-nfs-version", 1, 0, 'N' }, { "version", 0, 0, 'v' }, { "port", 1, 0, 'p' }, + { "no-tcp", 0, 0, 'n' }, { NULL, 0, 0, 0 } }; @@ -263,7 +264,7 @@ get_rootfh(struct svc_req *rqstp, dirpath *path, int *error, int v3) } else { struct nfs_fh_len *fh; - if (!exp->m_exported) + if (exp->m_exported<1) export_export(exp); if (!exp->m_xtabent) xtab_append(exp); @@ -419,6 +420,9 @@ main(int argc, char **argv) case 'N': nfs_version &= ~(1 << (atoi (optarg) - 1)); break; + case 'n': + _rpcfdtype = SOCK_DGRAM; + break; case 'V': nfs_version |= 1 << (atoi (optarg) - 1); break; @@ -445,6 +449,8 @@ main(int argc, char **argv) sigaction(SIGHUP, &sa, NULL); sigaction(SIGINT, &sa, NULL); sigaction(SIGTERM, &sa, NULL); + /* WARNING: the following works on Linux and SysV, but not BSD! */ + sigaction(SIGCHLD, &sa, NULL); if (nfs_version & 0x1) rpc_init("mountd", MOUNTPROG, MOUNTVERS, @@ -497,6 +503,6 @@ usage(const char *prog, int n) "Usage: %s [-Fhnv] [-d kind] [-f exports-file] [-V version]\n" " [-N version] [--debug kind] [-p|--port port] [--help] [--version]\n" " [--exports-file=file] [--nfs-version version]\n" -" [--no-nfs-version version]\n", prog); +" [--no-nfs-version version] [--no-tcp]\n", prog); exit(n); }