open(".",O_WRONLY) used uninitialized memory to decide whether
to succeed or fail - never a good idea ;)
* lib/open.c (open) [REPLACE_OPEN_DIRECTORY]: Correct typo.
Signed-off-by: Eric Blake <ebb9@byu.net>
2009-10-02 Eric Blake <ebb9@byu.net>
+ open: fix opening directory on mingw
+ * lib/open.c (open) [REPLACE_OPEN_DIRECTORY]: Correct typo.
+
test-open: on GNU/Hurd, /dev/null is a directory
* tests/test-fopen.h (main): Rename...
(test_fopen): ...to this. Use a guaranteed non-directory when
override fstat() in fchdir.c to hide the fact that we have a
dummy. */
if (REPLACE_OPEN_DIRECTORY && fd < 0 && errno == EACCES
- && (mode & O_ACCMODE) == O_RDONLY)
+ && (flags & O_ACCMODE) == O_RDONLY)
{
struct stat statbuf;
if (stat (filename, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))