0c66dc5fd7
Fix fopen(non-existing-file, re) errno bnc#713146 OBS-URL: https://build.opensuse.org/request/show/79427 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=92
15 lines
524 B
Diff
15 lines
524 B
Diff
Index: glibc-2.14/libio/fileops.c
|
|
===================================================================
|
|
--- glibc-2.14.orig/libio/fileops.c
|
|
+++ glibc-2.14/libio/fileops.c
|
|
@@ -338,7 +338,8 @@ _IO_new_file_fopen (fp, filename, mode,
|
|
is32not64);
|
|
|
|
#ifndef __ASSUME_O_CLOEXEC
|
|
- if ((fp->_flags2 & _IO_FLAGS2_CLOEXEC) != 0 && __have_o_cloexec <= 0)
|
|
+ if ((result != NULL)
|
|
+ && (fp->_flags2 & _IO_FLAGS2_CLOEXEC) != 0 && __have_o_cloexec <= 0)
|
|
{
|
|
int fd = _IO_fileno (fp);
|
|
if (__have_o_cloexec == 0)
|