Module Name: src
Committed By: pooka
Date: Fri May 8 13:03:46 UTC 2009
Modified Files:
src/tests/syscall: t_cmsg.c
Log Message:
lseek fd to start before sending, creates a clearer test case.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/syscall/t_cmsg.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/syscall/t_cmsg.c
diff -u src/tests/syscall/t_cmsg.c:1.5 src/tests/syscall/t_cmsg.c:1.6
--- src/tests/syscall/t_cmsg.c:1.5 Thu May 7 16:19:30 2009
+++ src/tests/syscall/t_cmsg.c Fri May 8 13:03:46 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: t_cmsg.c,v 1.5 2009/05/07 16:19:30 pooka Exp $ */
+/* $NetBSD: t_cmsg.c,v 1.6 2009/05/08 13:03:46 pooka Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@@ -141,6 +141,8 @@
if (rump_sys_write(fd, MAGICSTRING, sizeof(MAGICSTRING)) !=
sizeof(MAGICSTRING))
atf_tc_fail_errno("file write"); /* XXX: errno */
+ /* reset offset */
+ rump_sys_lseek(fd, 0, 0, SEEK_SET);
cmp = malloc(CMSG_LEN(sizeof(int)));
@@ -175,9 +177,8 @@
atf_tc_fail_errno("recvmsg failed");
rfd = *(int *)CMSG_DATA(cmp);
- /* set offset to 0 and read from the fd */
+ /* read from the fd */
memset(buf, 0, sizeof(buf));
- rump_sys_lseek(rfd, 0, 0, SEEK_SET);
if (rump_sys_read(rfd, buf, sizeof(buf)) == -1)
atf_tc_fail_errno("read rfd");