add exit on error
This commit is contained in:
parent
56d0721fa8
commit
176eb30d1c
1 changed files with 3 additions and 0 deletions
|
@ -52,14 +52,17 @@ main(void)
|
|||
ret = pipe2(spray[i], O_NONBLOCK);
|
||||
if (ret < 0) {
|
||||
printf("main: error: pipe2: object %lu\n", i);
|
||||
exit(-1);
|
||||
}
|
||||
ret = fcntl(spray[i][0], F_SETPIPE_SZ, 2 << 12);
|
||||
if (ret < 0) {
|
||||
printf("main: error: fcntl: object %lu\n", i);
|
||||
exit(-1);
|
||||
}
|
||||
ret = write(spray[i][1], buffer, 8);
|
||||
if (ret < 0) {
|
||||
printf("main: error: write: object %lu\n", i);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue