]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(process_block): (process_block): Save errno value from iconv call.
authorUlrich Drepper <drepper@redhat.com>
Tue, 19 Oct 1999 03:29:12 +0000 (03:29 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 19 Oct 1999 03:29:12 +0000 (03:29 +0000)
iconv/iconv_prog.c

index 78fa6234f49769edf7a8fd81cef8e1e234d5491c..fa226059191cbd0472df81f28f586f244d193968 100644 (file)
@@ -319,6 +319,8 @@ process_block (iconv_t cd, const char *addr, size_t len, FILE *output)
       if (outptr != outbuf)
        {
          /* We have something to write out.  */
+         int errno_save = errno;
+
          if (fwrite (outbuf, 1, outptr - outbuf, output) < outptr - outbuf
              || ferror (output))
            {
@@ -327,6 +329,8 @@ process_block (iconv_t cd, const char *addr, size_t len, FILE *output)
 conversion stopped due to problem in writing the output"));
              return -1;
            }
+
+         errno = errno_save;
        }
 
       if (n != (size_t) -1)