Deleted Added
sdiff udiff text old ( 186505 ) new ( 230226 )
full compact
1/*-
2 * Copyright (c) 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

28 */
29
30#if 0
31#ifndef lint
32static char sccsid[] = "@(#)getmntopts.c 8.3 (Berkeley) 3/29/95";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sbin/mount/getmntopts.c 186505 2008-12-26 22:55:38Z obrien $");
37
38#include <sys/param.h>
39#include <sys/mount.h>
40#include <sys/stat.h>
41#include <sys/uio.h>
42
43#include <err.h>
44#include <errno.h>

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

119
120 /* remove trailing slash if necessary */
121 if (rrpout - rrpoutstart > 1 && *(rrpout - 1) == '/')
122 *(rrpout - 1) = '\0';
123 else
124 *rrpout = '\0';
125}
126
127void
128checkpath(const char *path, char *resolved)
129{
130 struct stat sb;
131
132 if (realpath(path, resolved) != NULL && stat(resolved, &sb) == 0) {
133 if (!S_ISDIR(sb.st_mode))
134 errx(EX_USAGE, "%s: not a directory", resolved);
135 } else
136 errx(EX_USAGE, "%s: %s", resolved, strerror(errno));
137}
138
139void
140build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val,
141 size_t len)
142{
143 int i;
144

--- 38 unchanged lines hidden ---