iconv: Sync#1 with FreeBSD (minor)
authorJohn Marino <draco@marino.st>
Thu, 9 Jan 2014 23:34:37 +0000 (00:34 +0100)
committerSascha Wildner <saw@online.de>
Fri, 10 Jan 2014 18:54:52 +0000 (19:54 +0100)
This fixes a couple of minor bugs and removes WITH_LIBICONV_COMPAT
garbage, as seen in:
FreeBSD SVN 256833 (21 OCT 2013)
FreeBSD SVN 257583 (03 NOV 2013)
FreeBSD SVN 257858 (08 NOV 2013)

include/iconv.h
lib/libc/citrus/citrus_csmapper.h
lib/libc/citrus/citrus_mapper.c
lib/libc/iconv/Makefile.inc
lib/libc/iconv/iconv.c

index b8767e3..2cfbc96 100644 (file)
 #include <wchar.h>
 #include <sys/types.h>
 
-#ifdef __LIBICONV_COMPAT
-#define libiconv_open          iconv_open
-#define libiconv_close         iconv_close
-#define libiconv               iconv
-#define libiconv_t             iconv_t
-#endif
 #ifdef __cplusplus
 typedef        bool    __iconv_bool;
 #elif __STDC_VERSION__ >= 199901L
@@ -73,22 +67,10 @@ size_t      __iconv(iconv_t, const char **, size_t *, char **,
 /*
  * GNU interfaces for iconv
  */
-#ifdef __LIBICONV_COMPAT
-#define libiconv_open_into             iconv_open_into
-#define libiconvctl                    iconvctl
-#define libiconvlist                   iconvlist
-#define libiconv_set_relocation_prefix iconv_set_relocation_prefix
-#endif
-
 /* We have iconvctl() */
 #define _ICONV_VERSION 0x0108
 extern int _iconv_version;
 
-#ifdef __LIBICONV_COMPAT
-#define _libiconv_version              _iconv_version
-#define _LIBICONV_VERSION              _ICONV_VERSION
-#endif
-
 typedef struct {
        void    *spaceholder[64];
 } iconv_allocation_t;
index e9420af..d74cc7c 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 #ifndef _CITRUS_CSMAPPER_H_
-#define _CITRUS_CSMAPPER_H
+#define _CITRUS_CSMAPPER_H_
 
 #define _citrus_csmapper               _citrus_mapper
 #define _citrus_csmapper_close         _citrus_mapper_close
index 8052423..eb9f183 100644 (file)
@@ -381,7 +381,9 @@ _citrus_mapper_close(struct _citrus_mapper *cm)
                        _CITRUS_HASH_REMOVE(cm, cm_entry);
                        free(cm->cm_key);
                }
+               UNLOCK(&cm_lock);
                mapper_close(cm);
+               return;
 quit:
                UNLOCK(&cm_lock);
        }
index c9e014f..173714e 100644 (file)
@@ -4,9 +4,6 @@ CMAPS+= ${.CURDIR}/iconv/Symbol.map
 
 SRCS+= iconv.c
 
-# To establish libiconv functions as weak aliases, uncomment next line
-# CFLAGS+= -D__LIBICONV_COMPAT=1
-
 .if ${LIB} == "c"
 MAN+=  iconv.3 iconvctl.3 iconv_canonicalize.3 iconvlist.3 __iconv_get_list.3
 MLINKS+=iconv.3 iconvctl.3
index 97cc648..08e3fe0 100644 (file)
 #include "../citrus/citrus_hash.h"
 #include "../citrus/citrus_iconv.h"
 
-#ifdef __LIBICONV_COMPAT
-__weak_reference(iconv, libiconv);
-__weak_reference(iconv_open, libiconv_open);
-__weak_reference(iconv_open_into, libiconv_open_into);
-__weak_reference(iconv_close, libiconv_close);
-__weak_reference(iconvlist, libiconvlist);
-__weak_reference(iconvctl, libiconvctl);
-__weak_reference(iconv_set_relocation_prefix, libiconv_set_relocation_prefix);
-__weak_reference(_iconv_version, _libiconv_version);
-#endif
-
 #define ISBADF(_h_)    (!(_h_) || (_h_) == (iconv_t)-1)
 
 int _iconv_version = _ICONV_VERSION;