X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftest-open.h;h=cab1d27d9bd63aa17f879f0d4e5f678fed17a6a4;hb=06b335ade65c8fe60fee8b9e18b670bb54ed924a;hp=9b43945825b4624c98995717b05eadedc31fa091;hpb=48e988340f85e568ceb9ac1f4bf5824fddf1fd0d;p=gnulib.git diff --git a/tests/test-open.h b/tests/test-open.h index 9b4394582..cab1d27d9 100644 --- a/tests/test-open.h +++ b/tests/test-open.h @@ -1,5 +1,5 @@ /* Test of opening a file descriptor. - Copyright (C) 2007-2009 Free Software Foundation, Inc. + Copyright (C) 2007-2012 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) {