Commit 76374412 authored by Akshat Kumar's avatar Akshat Kumar Committed by Russ Cox

lib9, cmd/dist, cmd/ld: Plan 9: fix build

lib9: fix runcmd, removeall, and tempdir functions

cmd/dist: Include run_plan9.c and tempdir_plan9.c
        from lib9 for build, and in general consider
        file names containing "plan9" for building.

cmd/ld: provide function args for the new functions
        from lib9.

R=rsc, rminnich, ality, bradfitz
CC=golang-dev
https://golang.org/cl/7666043
parent 386ad0ab
......@@ -1070,7 +1070,8 @@ shouldbuild(char *file, char *dir)
name = lastelem(file);
if(streq(name, "goos.c") || streq(name, "flag.c"))
return 1;
return 0;
if(!contains(name, "plan9"))
return 0;
}
if(streq(dir, "libbio"))
return 0;
......
......@@ -556,6 +556,11 @@ hostobjs(void)
}
}
// provided by lib9
int runcmd(char**);
char* mktempdir(void);
void removeall(char*);
static void
rmtemp(void)
{
......
......@@ -15,9 +15,9 @@ runcmd(char **argv)
case -1:
return -1;
case 0:
execvp(argv[0], argv);
exec(argv[0], argv);
fprint(2, "exec %s: %r", argv[0]);
_exit(1);
exits("exec");
}
w = wait();
......
......@@ -9,7 +9,7 @@ char*
mktempdir(void)
{
char *p;
int i;
int fd, i;
p = smprint("/tmp/go-link-XXXXXX");
for(i=0; i<1000; i++) {
......@@ -27,7 +27,7 @@ mktempdir(void)
void
removeall(char *p)
{
int fd, n;
int fd, n, i;
Dir *d;
char *q;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment