Date: Thu, 22 Dec 2005 00:04:24 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 674 ************************************************** Wednesday 21 December 2005 Number 674 ************************************************** Subjects for today 1 Code to find configuration files in %ETC% : Paul Smedley **= Email 1 ==========================** Date: Wed, 21 Dec 2005 21:57:18 +1030 From: Paul Smedley Subject: Code to find configuration files in %ETC% Hi All, I'm having some trouble generating some clean code to make Bind 9.3.2 find it's configuration files in %ETC% instead of looking in a hardcoded directory. I have some code as per below to grab the ETC directory and append named.conf to it: #ifdef __INNOTEK_LIBC__ const char *env_path; (line 83) env_path=getenv("ETC"); #undef ns_g_conffile #define ns_g_conffile env_path #endif ns_g_conffile is defined to /bind/etc in another file. The above code works if it is within a function, however if I have it at the top of a .c file after all the #includes, etc I get an error like the following: include/named/globals.h:84: warning: type defaults to `int' in declaration of `e nv_path' include/named/globals.h:84: error: conflicting types for `env_path' include/named/globals.h:83: error: previous declaration of `env_path' include/named/globals.h:84: warning: data definition has no type or storage clas Anyone have any ideas why the same code works in a function and not in a header? Cheers, Paul.