1/* 2 * Copyright (c) 1992, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software donated to Berkeley by 6 * Jan-Simon Pendry. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 27 unchanged lines hidden (view full) --- 36 The Regents of the University of California. All rights reserved.\n"; 37#endif /* not lint */ 38 39#ifndef lint 40#if 0 41static char sccsid[] = "@(#)mount_fs.c 8.6 (Berkeley) 4/26/95"; 42#endif 43static const char rcsid[] = |
44 "$FreeBSD: head/sbin/mount/mount_fs.c 230226 2012-01-16 19:34:21Z jh $"; |
45#endif /* not lint */ 46 47#include <sys/param.h> 48#include <sys/mount.h> 49 50#include <err.h> 51#include <getopt.h> 52#include <libgen.h> --- 60 unchanged lines hidden (view full) --- 113 argc -= optind; 114 argv += optind; 115 if (argc != 2) 116 usage(); 117 118 dev = argv[0]; 119 dir = argv[1]; 120 |
121 if (checkpath(dir, mntpath) != 0) { 122 warn("%s", mntpath); 123 return (1); 124 } |
125 (void)rmslashes(dev, dev); 126 127 build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); 128 build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); 129 build_iovec(&iov, &iovlen, "from", dev, (size_t)-1); 130 build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); 131 132 ret = nmount(iov, iovlen, mntflags); 133 if (ret < 0) 134 err(1, "%s %s", dev, errmsg); 135 136 return (ret); 137} |