int main(void)
{
int fd;
- int status;
char buf[200];
const char *input;
/* This is how many tests you plan to run */
- plan_tests(4 * 6);
+ plan_tests(3 * 6);
foreach_ptr(input,
"This is a test\n",
write(fd, input, strlen(input));
lseek(fd, 0, SEEK_SET);
- if (fork() == 0)
- oserver_serve(fd);
-
- wait(&status);
-
- ok1(WIFEXITED(status));
- ok1(WEXITSTATUS(status) == 0);
+ ok1(oserver_serve(fd));
lseek(fd, 0, SEEK_SET);
buf[read(fd, buf, sizeof(buf)-1)] = '\0';