summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/main.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-01-04 22:08:20 +0000
committerpeter <peter@FreeBSD.org>2001-01-04 22:08:20 +0000
commitefbf261c68397211840db4989230161c3217ffb4 (patch)
tree371eb90d370f4550dabd7119699d8d6168393d73 /usr.sbin/config/main.c
parent886dcc6eec6457fd4387aade672ecc84bb308a1e (diff)
downloadFreeBSD-src-efbf261c68397211840db4989230161c3217ffb4.zip
FreeBSD-src-efbf261c68397211840db4989230161c3217ffb4.tar.gz
Try and stop config(8) from freaking out due to unnecessary paranoia
when using -d. Use realpath(3) to locate the top of the tree rather than trying to manually trim back the results of a getcwd(). Requested by: alfred
Diffstat (limited to 'usr.sbin/config/main.c')
-rw-r--r--usr.sbin/config/main.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 638ac90..9850a29 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -206,20 +206,9 @@ main(int argc, char **argv)
static void
get_srcdir(void)
{
- int i;
- char *p;
-
- (void)getcwd(srcdir, sizeof(srcdir));
- for (i = 0; i < 2; i++) {
- p = strrchr(srcdir, '/');
- if (p != NULL)
- *p = '\0';
- }
- /* Sanity check */
- p = strrchr(srcdir, '/');
- if (p == NULL || strcmp(p + 1, "sys"))
- errx(2, "non-standard kernel source tree");
+ if (realpath("../..", srcdir) == NULL)
+ errx(2, "Unable to find root of source tree");
}
static void
OpenPOWER on IntegriCloud