Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Delta Between Two Patch Sets: src/lib9/run_plan9.c

Issue 7523043: code review 7523043: lib9: add mktempdir, removeall, runprog (Closed)
Left Patch Set: Created 12 years, 1 month ago
Right Patch Set: diff -r d8a691500f6f https://code.google.com/p/go/ Created 12 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/dist/windows.c ('k') | src/lib9/run_unix.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 #include <u.h>
6 #include <libc.h>
7
8 int
9 runcmd(char **argv)
10 {
11 int pid;
12 Waitmsg *w;
13 ········
14 switch(pid = fork()) {
15 case -1:
16 return -1;
17 case 0:
18 execvp(argv[0], argv);
19 fprint(2, "exec %s: %r", argv[0]);
20 _exit(1);
21 }
22 ········
23 w = wait();
24 if(w == nil)
25 return -1;
26 if(w->pid != pid) {
27 werrstr("unexpected pid in wait");
28 free(w);
29 return -1;
30 }
31 if(w->msg[0]) {
32 werrstr("unsuccessful exit status: %s", w->msg);
33 free(w);
34 return -1;
35 }
36 free(w);
37 return 0;
38 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b