diff --git a/regress/sys/kern/kqueue/read/fifo/fifo.c b/regress/sys/kern/kqueue/read/fifo/fifo.c index ced0946ed9c4..14b3ba464b71 100644 --- a/regress/sys/kern/kqueue/read/fifo/fifo.c +++ b/regress/sys/kern/kqueue/read/fifo/fifo.c @@ -1,4 +1,4 @@ -/* $NetBSD: fifo.c,v 1.2 2002/10/29 10:39:36 martin Exp $ */ +/* $NetBSD: fifo.c,v 1.3 2006/09/29 14:18:25 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -115,6 +115,11 @@ main(int argc, char **argv) printf("fifo: incorrect filter, expecting EVFILT_READ\n"); n = read(fd, buffer, event[0].data); + if (n < 0) { + warn("read"); + error = 1; + goto out; + } buffer[n] = '\0'; printf("fifo: read '%s'\n", buffer); diff --git a/regress/sys/kern/kqueue/read/file/file.c b/regress/sys/kern/kqueue/read/file/file.c index 0e36b202a40c..f72435c03db1 100644 --- a/regress/sys/kern/kqueue/read/file/file.c +++ b/regress/sys/kern/kqueue/read/file/file.c @@ -1,4 +1,4 @@ -/* $NetBSD: file.c,v 1.3 2002/12/06 02:06:16 thorpej Exp $ */ +/* $NetBSD: file.c,v 1.4 2006/09/29 14:18:25 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -104,6 +104,8 @@ main(int argc, char **argv) #endif n = read(fd, buffer, 128); + if (n < 0) + err(1, "read"); buffer[n] = '\0'; printf("file(%d): %s", num, buffer); } diff --git a/regress/sys/kern/kqueue/read/pipe1/pipe1.c b/regress/sys/kern/kqueue/read/pipe1/pipe1.c index 8026d1541ae9..c19d24acfccb 100644 --- a/regress/sys/kern/kqueue/read/pipe1/pipe1.c +++ b/regress/sys/kern/kqueue/read/pipe1/pipe1.c @@ -1,4 +1,4 @@ -/* $NetBSD: pipe1.c,v 1.1.1.1 2002/10/03 07:46:03 jdolecek Exp $ */ +/* $NetBSD: pipe1.c,v 1.2 2006/09/29 14:18:25 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -82,6 +82,8 @@ main(int argc, char **argv) n, event[0].flags, event[0].fflags, event[0].data); n = read(fds[0], buffer, event[0].data); + if (n < 0) + err(1, "read"); buffer[n] = '\0'; printf("pipe: read '%s'\n", buffer); diff --git a/regress/sys/kern/kqueue/vnode/vnode.c b/regress/sys/kern/kqueue/vnode/vnode.c index 303b1ce12312..32413cc5eaa6 100644 --- a/regress/sys/kern/kqueue/vnode/vnode.c +++ b/regress/sys/kern/kqueue/vnode/vnode.c @@ -1,4 +1,4 @@ -/* $NetBSD: vnode.c,v 1.2 2003/10/21 09:42:48 itojun Exp $ */ +/* $NetBSD: vnode.c,v 1.3 2006/09/29 14:18:25 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -139,6 +139,8 @@ main(int argc, char **argv) if (event[0].data < 0) lseek(fd, 0, SEEK_END); n = read(fd, buffer, 128); + if (n < 0) + err(1, "read"); buffer[n] = '\0'; printf("[%d] %s", n, buffer); } diff --git a/regress/sys/kern/kqueue/write/inet/inet.c b/regress/sys/kern/kqueue/write/inet/inet.c index a9615c2f3111..5800265b0115 100644 --- a/regress/sys/kern/kqueue/write/inet/inet.c +++ b/regress/sys/kern/kqueue/write/inet/inet.c @@ -1,4 +1,4 @@ -/* $NetBSD: inet.c,v 1.6 2006/05/10 19:10:09 mrg Exp $ */ +/* $NetBSD: inet.c,v 1.7 2006/09/29 14:18:25 christos Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -273,6 +273,8 @@ printf("ir: match is %d\n", match); /* sleep(1); */ continue; n = read(fd, buffer, 128); + if (n < 0) + err(1, "read"); buffer[n] = '\0'; buffer[0] = '\0'; printf("[%d] %s", n, buffer);