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
This commit is contained in:
peter 2001-01-04 22:08:20 +00:00
parent 886dcc6eec
commit efbf261c68

View File

@ -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