~ubuntu-branches/ubuntu/raring/eglibc/raring

« back to all changes in this revision

Viewing changes to libio/fileops.c

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-01-30 20:49:20 UTC
  • mfrom: (308.1.17 raring)
  • Revision ID: package-import@ubuntu.com-20130130204920-avb0aseqq7a8j19l
Tags: 2.17-0ubuntu2
* Merge with Debian experimental, bringing in several small fixes.
* Sync Ubuntu's expected testsuite results with Debian's new ones.

Show diffs side-by-side

added added

removed removed

Lines of Context:
336
336
  if (result != NULL)
337
337
    {
338
338
#ifndef __ASSUME_O_CLOEXEC
339
 
      if ((fp->_flags2 & _IO_FLAGS2_CLOEXEC) != 0 && __have_o_cloexec <= 0)
340
 
        {
341
 
          int fd = _IO_fileno (fp);
342
 
          if (__have_o_cloexec == 0)
 
339
# ifdef O_CLOEXEC
 
340
      if (__have_o_cloexec <= 0)
 
341
# endif
 
342
        {
 
343
          if ((fp->_flags2 & _IO_FLAGS2_CLOEXEC) != 0)
343
344
            {
 
345
              int fd = _IO_fileno (fp);
344
346
              int flags = __fcntl (fd, F_GETFD);
345
 
              __have_o_cloexec = (flags & FD_CLOEXEC) == 0 ? -1 : 1;
 
347
# ifdef O_CLOEXEC
 
348
              if (__have_o_cloexec == 0)
 
349
                __have_o_cloexec = (flags & FD_CLOEXEC) == 0 ? -1 : 1;
 
350
              if (__have_o_cloexec < 0)
 
351
# endif
 
352
                {
 
353
                  flags |= FD_CLOEXEC;
 
354
                  __fcntl (fd, F_SETFD, flags);
 
355
                }
346
356
            }
347
 
          if (__have_o_cloexec < 0)
348
 
            __fcntl (fd, F_SETFD, FD_CLOEXEC);
349
357
        }
350
358
#endif
351
359