]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(_IO_file_open): Close file descriptor if _IO_SEEKOFF call failed.
authorUlrich Drepper <drepper@redhat.com>
Sat, 16 Mar 2002 04:01:02 +0000 (04:01 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 16 Mar 2002 04:01:02 +0000 (04:01 +0000)
libio/fileops.c

index f67eeefe6e5085d661b248586475b871fd018177..e732e9277c16e22f3e8ebf393b825d22b70d967e 100644 (file)
@@ -230,7 +230,10 @@ _IO_file_open (fp, filename, posix_mode, prot, read_write, is32not64)
   if (read_write & _IO_IS_APPENDING)
     if (_IO_SEEKOFF (fp, (_IO_off64_t)0, _IO_seek_end, _IOS_INPUT|_IOS_OUTPUT)
        == _IO_pos_BAD && errno != ESPIPE)
-      return NULL;
+      {
+       close (fdesc);
+       return NULL;
+      }
   _IO_link_in ((struct _IO_FILE_plus *) fp);
   return fp;
 }