}
int do_child(int terminal) {
- int retval;
struct timeval tv;
/* Going to sleep for two seconds to allow the parent proc to get ready */
select(0, NULL, NULL, NULL, &tv);
/* Try to write. Doesn't matter how many bytes we actually send. */
- retval = write(terminal, SENDSTRING, strlen(SENDSTRING));
+ (void) write(terminal, SENDSTRING, strlen(SENDSTRING));
close(terminal);
/* Wait for another second to allow the parent to process incoming data */
tv.tv_usec = 1000000;
- retval = select(0,NULL, NULL, NULL, &tv);
+ (void) select(0,NULL, NULL, NULL, &tv);
exit(0);
}
void do_child(void) {
struct timeval tv;
- int retval;
/* Open named pipe for writing. This will block until a reader arrives. */
if((fd_np1 = open(NAMEDPIPE1, O_WRONLY)) == -1) {
select(0, NULL, NULL, NULL, &tv);
/* Try to write. Doesn't matter how many bytes we actually send. */
- retval = write(fd_np1, SENDSTRING, strlen(SENDSTRING));
+ (void) write(fd_np1, SENDSTRING, strlen(SENDSTRING));
/* Wait for another second to allow the parent to process incoming data */
tv.tv_sec = DO_HANDLEDATA;
tv.tv_usec = 0;
- retval = select(0,NULL, NULL, NULL, &tv);
+ (void) select(0,NULL, NULL, NULL, &tv);
close(fd_np1);
/* Wait for another second to allow the parent to process incoming data */
tv.tv_sec = DO_HANDLEDATA;
tv.tv_usec = 0;
- retval = select(0,NULL, NULL, NULL, &tv);
+ (void) select(0,NULL, NULL, NULL, &tv);
/* Open named pipe for reading. This will block until a writer arrives. */
if((fd_np2 = open(NAMEDPIPE2, O_RDONLY)) == -1) {
/* Wait for another second to allow the parent to run some tests. */
tv.tv_sec = DO_HANDLEDATA;
tv.tv_usec = 0;
- retval = select(0, NULL, NULL, NULL, &tv);
+ (void) select(0, NULL, NULL, NULL, &tv);
close(fd_np2);
/* Let the parent do initial read and write tests from and to the pipe. */
tv.tv_sec = DO_PAUSE;
tv.tv_usec = 0;
- retval = select(0, NULL, NULL, NULL, &tv);
+ (void) select(0, NULL, NULL, NULL, &tv);
/* Unblock blocking read select by writing data */
if(write(fd_ap[1], SENDSTRING, strlen(SENDSTRING)) < 0) {
void do_child(void) {
struct timeval tv;
- int retval;
/* Let the parent do initial read and write tests from and to the pipe. */
tv.tv_sec = DO_PAUSE + DO_PAUSE + DO_PAUSE + 1;
tv.tv_usec = 0;
- retval = select(0, NULL, NULL, NULL, &tv);
+ (void) select(0, NULL, NULL, NULL, &tv);
/* At this point the parent has a pending select with a DO_TIMEOUT timeout.
We're going to interrupt by sending a signal */
void child(i)
int i;
{
- int n;
-
- n = getpid();
+ (void) getpid();
exit(100+i);
}
void spawn(n)
int n;
{
- int pid, k;
+ int pid;
if ((pid = fork()) != 0) {
wait(&n); /* wait for some child (any one) */
} else {
- k = execl(name[n], name[n], (char *) 0);
+ execl(name[n], name[n], (char *) 0);
errct++;
printf("Child execl didn't take. file=%s errno=%d\n", name[n], errno);
rmfiles();
int main(int argc, char *argv[])
{
- int i, m = 0xFFFF;
+ int i;
sync();
- if (argc == 2) m = atoi(argv[1]);
-
/* If we have to check things, call do_check(). */
if (strcmp(argv[0], "DO CHECK") == 0) exit(do_check());
/* When a signal knocks a processes out of WAIT or PAUSE, it is supposed to
* get EINTR as error status. Check that.
*/
- int n, j;
+ int n;
subtest = 5;
if (signal(8, func8) == SIG_ERR) e(25);
if (wait(&n) < 0) e(27);
if (signal(8, SIG_DFL) == SIG_ERR) e(28);
} else {
- j = pause();
+ (void) pause();
if (errno != EINTR && -errno != EINTR) e(29);
exit(0);
}
/* When a signal knocks a processes out of PIPE, it is supposed to
* get EINTR as error status. Check that.
*/
- int n, j, fd[2];
+ int n, fd[2];
subtest = 8;
unlink("XXX.test5");
if (close(fd[1]) != 0) e(6);
} else {
if (creat("XXX.test5", 0777) < 0) e(7);
- j = read(fd[0], (char *) &n, 1);
+ (void) read(fd[0], (char *) &n, 1);
if (errno != EINTR) e(8);
exit(0);
}
int sd;
int sd2;
int rc;
- int on;
debug("entering test_bind()");
- on = 1;
UNLINK(TEST_SUN_PATH);
memset(&addr, '\0', sizeof(struct sockaddr_un));
addr.sun_family = AF_UNIX;
*/
void test_xfer_server(pid_t pid)
{
- socklen_t ucred_length;
int i;
- int on;
struct timeval tv;
fd_set readfds;
int status;
struct sockaddr_un addr;
struct sockaddr_un client_addr;
- on = 1;
status = 0;
rc = 0;
sd = 0;
- ucred_length = sizeof(struct ucred);
client_sd = 0;
client_addr_size = sizeof(struct sockaddr_un);
pid_t pid;
int sd, rc, status;
struct sockaddr_un addr;
- socklen_t client_addr_size;
-
- client_addr_size = sizeof(struct sockaddr_un);
memset(&addr, '\0', sizeof(struct sockaddr_un));
addr.sun_family = AF_UNIX;
p = &buf[10];
i = 200;
p = &buf[20];
+
+#ifdef __GNUC__
+ /*
+ * to defeat the smartness of the GNU C optimizer we pretend we
+ * use 'a'. Otherwise the optimizer will not detect the looping
+ * effectuated by setjmp/longjmp, so that it thinks it can get
+ * rid of the assignment to 'a'.
+ */
+ srand(i);
+ srand((int)*p);
+#endif
+
longjmp(env, 2);
}