plot: handle create() failure
This commit is contained in:
parent
9d1e80cbbb
commit
33131a98b9
1 changed files with 2 additions and 1 deletions
|
@ -673,7 +673,8 @@ int server(void){
|
|||
int fd, p[2];
|
||||
char buf[32];
|
||||
pipe(p);
|
||||
fd = create("/srv/plot", 1, 0666);
|
||||
if((fd = create("/srv/plot", OWRITE, 0666)) < 0)
|
||||
sysfatal("open: %r");
|
||||
sprint(buf, "%d", p[1]);
|
||||
write(fd, buf, strlen(buf));
|
||||
close(fd);
|
||||
|
|
Loading…
Reference in a new issue