History

more work on 9pfile interface

John (EBo) David committed 15 years ago

Commit b352aa61 parent c41ff912 files · +15 −11Browse files

Unified · Split

2 files
  1. sys/src/cmd/uem/exec2fs.c +8 −2
  2. sys/src/cmd/uem/tests/exec2fs.rc +7 −9
sys/src/cmd/uem/exec2fs.c+8−2
@@ -185,8 +185,13 @@ kickit(void) · 184 unmodified lines
185185 // create a execcmd shadow directory
186186 spid = smprint("%ld", pid);
187187 fdir = createfile(fs.tree->root, spid, "exec2fs", DMDIR|0777, (void *)Xpid);
188− free(spid);
189188 closefile(createfile(fdir, "ctl", "exec2fs", 0666, (void *)Xpctl));
189+
190+ closefile(createfile(fdir, "stdin", "exec2fs", 0666, (void *)Xpctl));
191+ closefile(createfile(fdir, "stdout", "exec2fs", 0666, (void *)Xpctl));
192+ closefile(createfile(fdir, "stderr", "exec2fs", 0666, (void *)Xpctl));
193+
194+ free(spid);
190195 closefile(fdir);
191196
192197 chanfree(pidc);
@@ -260,10 +265,11 @@ fsopen(Req *r) · 67 unmodified lines
260265 }
261266 DPRINT(DFID, "\tctlfd=(%d)\n", e->rctlfd);
262267
268+
263269 n = snprint(fname, STRMAX, "%s/%d", procpath, e->pid);
264270 assert(n > 0);
265271
266− /* asserts are heavy handed, but help with debug */
272+ // asserts are heavy handed, but help with debug
267273 n = mpipe(fname, "stdin");
268274 assert(n > 0);
269275 n = mpipe(fname, "stdout");
sys/src/cmd/uem/tests/exec2fs.rc+7−9
@@ -13,7 +13,7 @@ EXECLOG=$TESTDIR/exec2fs.log · 12 unmodified lines
1313 MPIPELOG=$TESTDIR/mpipefs.log
1414 ERRORLOG=$TESTDIR/error.log
1515
16−E_MNTPATH=/tmp/testbed/E
16+E_MNTPATH=$TESTDIR/E
1717
1818 #
1919 # Cleanup Previous Instances
@@ -46,13 +46,12 @@ fn startup { · 26 unmodified lines
4646 echo Starting mpipefs....
4747
4848 mkdir -p $E_MNTPATH
49− mkdir -p $TESTDIR
5049
5150 if(~ $#* 0) {
5251 ../$O.mpipefs >[2] $MPIPELOG
5352 }
5453 if not {
55− ../$O.mpipefs -D -v $1 >[2] $MPIPELOG # CHATTY
54+ ../$O.mpipefs -v $1 >[2] $MPIPELOG # CHATTY
5655 }
5756
5857 mount /srv/mpipe /n/mpipetest test
@@ -62,7 +61,7 @@ fn startup { · 3 unmodified lines
6261 ../$O.exec2fs -s exec2fs -E ../$O.execcmd -m $E_MNTPATH >[2] $EXECLOG
6362 }
6463 if not {
65− ../$O.exec2fs -D -v $1 -s exec2fs -E ../$O.execcmd -m $E_MNTPATH >[2] $EXECLOG # CHATTY
64+ ../$O.exec2fs -v $1 -s exec2fs -E ../$O.execcmd -m $E_MNTPATH >[2] $EXECLOG # CHATTY
6665 }
6766 bind -bc '#p' $E_MNTPATH
6867
@@ -109,8 +108,6 @@ fn stdout { · 40 unmodified lines
109108 }
110109
111110 echo Success!
112− # cleanup
113− rm -rf $TESTDIR/*
114111 }
115112
116113 fn stdin {
@@ -130,17 +127,18 @@ fn stdin { · 13 unmodified lines
130127 }
131128
132129 echo Success!
133− # cleanup
134− rm -rf $TESTDIR/*
135130 }
136131
137132 # Setup
138133 rfork
139134
140135 cleanup
141−startup $1
136+shutdown
137+
142138 testdir
143139
140+startup $1
141+
144142 # Note: the current tests die on the 4'th run of either stdout or
145143 # stdin. If I run cleanup**startup between each it runs fine. For
146144 # now I am leaving it at two tests and will look into it later.