From dcbe8ff7a96a238fe3fa8ef8313ccf78716238df Mon Sep 17 00:00:00 2001 From: joerg Date: Mon, 3 Oct 2005 17:52:10 +0000 Subject: stdout may not be a link-time constant. E.g. on DragonFly, it is just an extern pointer. Move the compile-time initialisation to run time. --- x11/XmHTML/patches/patch-ai | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 x11/XmHTML/patches/patch-ai (limited to 'x11/XmHTML/patches') diff --git a/x11/XmHTML/patches/patch-ai b/x11/XmHTML/patches/patch-ai new file mode 100644 index 00000000000..a87a7a815ae --- /dev/null +++ b/x11/XmHTML/patches/patch-ai @@ -0,0 +1,42 @@ +$NetBSD: patch-ai,v 1.1 2005/10/03 17:52:10 joerg Exp $ + +--- lib/common/debug.c.orig 2005-08-16 19:40:17.000000000 +0000 ++++ lib/common/debug.c +@@ -110,7 +110,7 @@ int debug_disable_warnings = 0; + /*** Private Function Prototype Declarations ****/ + + /*** Private Variable Declarations ***/ +-static FILE *__rsd_debug_file = stdout; ++static FILE *__rsd_debug_file = NULL; + + /***** + * When debug output is send to a file, we register an exit func to close +@@ -128,7 +128,8 @@ __rsd_at_exit(void) + #endif + { + /* close output file */ +- fclose(__rsd_debug_file); ++ if (__rsd_debug_file != NULL) ++ fclose(__rsd_debug_file); + } + + /***** +@@ -159,6 +160,9 @@ __rsd_fprintf(fmt, va_alist) + va_start(arg_list); + #endif /* __STDC__ */ + ++ if (__rsd_debug_file == NULL) ++ __rsd_debug_file = stdout; ++ + /* flush to file */ + vfprintf(__rsd_debug_file, fmt, arg_list); + va_end(arg_list); +@@ -298,7 +302,7 @@ __rsd_setDebugLevels(int *argc, char **a + if((chPtr = strstr(argv[i], ":")) != NULL) + { + /* close any existing output file */ +- if(__rsd_debug_file != stdout) ++ if(__rsd_debug_file != stdout && __rsd_debug_file != NULL) + fclose(__rsd_debug_file); + + chPtr++; /* skip : */ -- cgit v1.2.3