This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix undeclared variable in glibc master fileops.c


Since

commit 94b7cc3711b0b74c1d3ae18b9a2e019e51a8e0bf
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Sun May 15 15:28:46 2011 -0400

    Fix a few problems in fopen and freopen

I need the following patch to compile glibc master on F14
because fd is not defined.

-Andi

2011-05-16  Andi Kleen  <ak@linux.intel.com>

	* libio/fileops.c (_IO_new_file_fopen): Use fileno to access
	Unix file descriptor.

diff --git a/libio/fileops.c b/libio/fileops.c
index 2b696ab..441deda 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -350,11 +350,11 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
     {
       if (__have_o_cloexec == 0)
 	{
-	  int flags = __fcntl (fd, F_GETFD);
+	  int flags = __fcntl (fileno (fp), F_GETFD);
 	  __have_o_cloexec = (flags & FD_CLOEXEC) == 0 ? -1 : 1;
 	}
       if (__have_o_cloexec < 0)
-	__fcntl (fd, F_SETFD, FD_CLOEXEC);
+	__fcntl (fileno (fp), F_SETFD, FD_CLOEXEC);
     }
 #endif
 

-- 
ak@linux.intel.com -- Speaking for myself only


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]