- if (!child) {
- /* Make sure they started writing. */
- if (read(p2c[0], buffer, 1) != 1)
- exit(1);
- if (kill(getppid(), SIGUSR1) != 0)
- exit(2);
- if (!read_all(p2c[0], buffer+1, sizeof(buffer)-1))
- exit(3);
- if (memchr(buffer, 0, sizeof(buffer))) {
- fprintf(stderr, "buffer has 0 at offset %i\n",
- memchr(buffer, 0, sizeof(buffer)) - (void *)buffer);
- exit(4);
- }
- exit(0);
- }
- if (child == -1)
- err(1, "forking");
+ write_return = -EINTR;
+ ok1(write_all(100, buffer, BUFSZ));
+ ok1(errno == EINTR);
+
+ write_return = 1;
+ errno = 0;
+ ok1(write_all(100, buffer, BUFSZ));
+ ok1(errno == 0);
+
+ write_return = BUFSZ;
+ ok1(write_all(100, buffer, BUFSZ));
+ ok1(errno == 0);