X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-open.h;h=2ba5d137bf87fd8ceec029b4af1ce61e7063e971;hb=6267b9ec0238f2b31c44644d75ce98e97349ef25;hp=6341a6358611f5c253c9c6a5eb8a5c1e1410624d;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=pspp diff --git a/tests/test-open.h b/tests/test-open.h index 6341a63586..2ba5d137bf 100644 --- a/tests/test-open.h +++ b/tests/test-open.h @@ -1,5 +1,5 @@ /* Test of opening a file descriptor. - Copyright (C) 2007-2010 Free Software Foundation, Inc. + Copyright (C) 2007-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,6 +63,12 @@ test_open (int (*func) (char const *, int, ...), bool print) ASSERT (write (fd, "c", 1) == 1); ASSERT (close (fd) == 0); + /* Although O_NONBLOCK on regular files can be ignored, it must not + cause a failure. */ + fd = func (BASE "file", O_NONBLOCK | O_RDONLY); + ASSERT (0 <= fd); + ASSERT (close (fd) == 0); + /* Symlink handling, where supported. */ if (symlink (BASE "file", BASE "link") != 0) {