summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-03-16 04:00:20 +0000
committerUlrich Drepper <drepper@redhat.com>2002-03-16 04:00:20 +0000
commit2c617417f4a49076e444600855a61338eac6350c (patch)
treee57765ee82ed0b3b02ada62f3fb9189f866b697e /libio
parent5241882ce2d21c23035a00d252b2c4668529fb31 (diff)
downloadglibc-2c617417f4a49076e444600855a61338eac6350c.tar.gz
glibc-2c617417f4a49076e444600855a61338eac6350c.tar.xz
glibc-2c617417f4a49076e444600855a61338eac6350c.zip
Update.
2002-03-15  Ulrich Drepper  <drepper@redhat.com>

	* libio/iofdopen.c (_IO_new_fdopen): Call _IO_setb to deallocate
	buffers if _IO_file_attach failed.

	* libio/fileops.c (_IO_file_open): Close file descriptor if
	_IO_SEEKOFF call failed.

	* iconv/gconv_conf.c: Add internal_function to __gconv_get_path
Diffstat (limited to 'libio')
-rw-r--r--libio/fileops.c5
-rw-r--r--libio/iofdopen.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/libio/fileops.c b/libio/fileops.c
index a53f89fd75..dbea6318f0 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -234,7 +234,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;
+      }
   INTUSE(_IO_link_in) ((struct _IO_FILE_plus *) fp);
   return fp;
 }
diff --git a/libio/iofdopen.c b/libio/iofdopen.c
index a4ac03fe5d..ee8caa3604 100644
--- a/libio/iofdopen.c
+++ b/libio/iofdopen.c
@@ -132,6 +132,7 @@ _IO_new_fdopen (fd, mode)
 #endif
   if (INTUSE(_IO_file_attach) ((_IO_FILE *) &new_f->fp, fd) == NULL)
     {
+      INTUSE(_IO_setb) (&new_f->fp, NULL, NULL, 0);
       INTUSE(_IO_un_link) (&new_f->fp);
       free (new_f);
       return NULL;