Code

Merged branch 'master' of git://git.tokkee.org/sysdb.
[sysdb.git] / t / utils / unixsock_test.c
index 0122d5f80316a5f3e45eee442e80022901365cf2..4502767868051bfb6ff33466b65f83283c0acdb8 100644 (file)
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#if HAVE_CONFIG_H
+#      include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 /* required for fopencookie support */
 #define _GNU_SOURCE
 
@@ -200,7 +204,9 @@ fdopen(int fd, const char *mode)
         * to use the original implementation */
        if (fd != myfd) {
                void *libc = dlopen_libc();
-               FILE *(*orig_fdopen)(int, const char *) = dlsym(libc, "fdopen");
+               FILE *(*orig_fdopen)(int, const char *);
+
+               orig_fdopen = (FILE *(*)(int, const char *))dlsym(libc, "fdopen");
 
                if (! orig_fdopen)
                        fail("INTERNAL ERROR: failed to load fdopen() from libc");