summaryrefslogtreecommitdiff
path: root/source/lib/iconv.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-07-07 19:18:31 +0000
committerGerald Carter <jerry@samba.org>2004-07-07 19:18:31 +0000
commit0cf550c32aa0018ad834fc2d3cd90d9b2b146621 (patch)
tree687da224b86274ebc9c46591a812d206935c8efd /source/lib/iconv.c
parent99c6d9bd34b106ae5109ffed4812b89ef0f3eaa8 (diff)
downloadsamba-0cf550c32aa0018ad834fc2d3cd90d9b2b146621.tar.gz
r1383: sync from 3.0 tree
Diffstat (limited to 'source/lib/iconv.c')
-rw-r--r--source/lib/iconv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/lib/iconv.c b/source/lib/iconv.c
index 7df73192f24..4c9ecf992e6 100644
--- a/source/lib/iconv.c
+++ b/source/lib/iconv.c
@@ -129,7 +129,11 @@ static size_t sys_iconv(void *cd,
size_t ret = iconv((iconv_t)cd,
inbuf, inbytesleft,
outbuf, outbytesleft);
- if (ret == (size_t)-1) iconv(cd, NULL, NULL, NULL, NULL);
+ if (ret == (size_t)-1) {
+ int saved_errno = errno;
+ iconv(cd, NULL, NULL, NULL, NULL);
+ errno = saved_errno;
+ }
return ret;
#else
errno = EINVAL;