glibc/fopen-close-exec.patch
Sascha Peilicke 8f2de66f49 Accepting request 79428 from Base:System
Fix fopen(non-existing-file, re) errno bnc#713146 (forwarded request 79427 from a_jaeger)

OBS-URL: https://build.opensuse.org/request/show/79428
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glibc?expand=0&rev=75
2011-08-22 13:14:16 +00:00

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)