The manual for open(2) says that -1 indicate a failure, not 0. And I
really don't think testing the behaviour of open(2) is the subject of that regression test. Maybe it was a developer regression test? Do I get a cookie?
This commit is contained in:
parent
9ebb7ae9e0
commit
d84fe1a4d1
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: preempt1.c,v 1.2 2003/06/27 13:27:58 skrll Exp $ */
|
||||
/* $NetBSD: preempt1.c,v 1.3 2006/04/12 14:01:52 cube Exp $ */
|
||||
|
||||
#include <assert.h>
|
||||
#include <err.h>
|
||||
|
@ -32,7 +32,7 @@ main(int argc, char *argv[])
|
|||
err(1, "malloc");
|
||||
|
||||
fd = open("/dev/urandom", O_RDONLY, 0);
|
||||
if (fd == 0)
|
||||
if (fd == -1)
|
||||
err(1, "open");
|
||||
|
||||
printf("1: preempt test\n");
|
||||
|
|
Loading…
Reference in New Issue