Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F111035612
D26734.id97531.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D26734.id97531.diff
View Options
diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c
--- a/usr.sbin/crunch/crunchgen/crunchgen.c
+++ b/usr.sbin/crunch/crunchgen/crunchgen.c
@@ -639,7 +639,6 @@
{
char path[MAXPATHLEN];
char line[MAXLINELEN];
- FILE *f;
snprintf(line, MAXLINELEN, "filling in parms for %s", p->name);
status(line);
@@ -654,22 +653,9 @@
/* Determine the actual srcdir (maybe symlinked). */
if (p->srcdir) {
- snprintf(line, MAXLINELEN, "cd %s && pwd -P", p->srcdir);
- f = popen(line,"r");
- if (!f)
- errx(1, "Can't execute: %s\n", line);
-
- path[0] = '\0';
- fgets(path, sizeof path, f);
- if (pclose(f))
- errx(1, "Can't execute: %s\n", line);
-
- if (!*path)
- errx(1, "Can't perform pwd on: %s\n", p->srcdir);
-
- /* Chop off trailing newline. */
- path[strlen(path) - 1] = '\0';
- p->realsrcdir = strdup(path);
+ p->realsrcdir = realpath(p->srcdir, NULL);
+ if (p->realsrcdir == NULL)
+ errx(1, "Can't resolve path: %s\n", p->srcdir);
}
/* Unless the option to make object files was specified the
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 27, 12:41 PM (19 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16868709
Default Alt Text
D26734.id97531.diff (1 KB)
Attached To
Mode
D26734: crunchgen: replace "cd p->srcdir && pwd -P" with realpath(p->srcdir)
Attached
Detach File
Event Timeline
Log In to Comment