Module Name: src Committed By: pooka Date: Mon Mar 14 20:41:25 UTC 2011
Modified Files: src/tests/kernel: t_posix_fadvise.c Log Message: Use /dev/null instead of stdin for fd. Otherwise if the tests are run with stdin as a pipe (e.g. from cron) the test fails with ESPIPE. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/kernel/t_posix_fadvise.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/kernel/t_posix_fadvise.c diff -u src/tests/kernel/t_posix_fadvise.c:1.5 src/tests/kernel/t_posix_fadvise.c:1.6 --- src/tests/kernel/t_posix_fadvise.c:1.5 Thu Dec 30 22:23:13 2010 +++ src/tests/kernel/t_posix_fadvise.c Mon Mar 14 20:41:25 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: t_posix_fadvise.c,v 1.5 2010/12/30 22:23:13 pooka Exp $ */ +/* $NetBSD: t_posix_fadvise.c,v 1.6 2011/03/14 20:41:25 pooka Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ #include <sys/cdefs.h> __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_posix_fadvise.c,v 1.5 2010/12/30 22:23:13 pooka Exp $"); +__RCSID("$NetBSD: t_posix_fadvise.c,v 1.6 2011/03/14 20:41:25 pooka Exp $"); #include <sys/fcntl.h> @@ -88,11 +88,13 @@ ATF_TC_BODY(posix_fadvise, tc) { - int fd = STDIN_FILENO; + int fd; int pipe_fds[2]; int badfd = 10; int ret; + RL(fd = open("/dev/null", O_RDWR)); + (void)close(badfd); RL(pipe(pipe_fds));