]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
use isc_file_absolutepath()
authorAndreas Gustafsson <source@isc.org>
Mon, 16 Jul 2001 17:32:49 +0000 (17:32 +0000)
committerAndreas Gustafsson <source@isc.org>
Mon, 16 Jul 2001 17:32:49 +0000 (17:32 +0000)
bin/named/main.c

index a17606a3498daf7556a793d14e482b1034fe1ff7..a5fc459c577addcd708602a2346bd10a82c439ae 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: main.c,v 1.116 2001/06/28 01:08:24 marka Exp $ */
+/* $Id: main.c,v 1.117 2001/07/16 17:32:49 gson Exp $ */
 
 #include <config.h>
 
@@ -482,20 +482,13 @@ setup(void) {
         * directory's name before possibly changing to another directory.
         */
        if (! isc_file_isabsolute(ns_g_conffile)) {
-               result = isc_dir_current(absolute_conffile,
-                                        sizeof(absolute_conffile), ISC_TRUE);
+               result = isc_file_absolutepath(ns_g_conffile,
+                                              absolute_conffile,
+                                              sizeof(absolute_conffile));
                if (result != ISC_R_SUCCESS)
-                       ns_main_earlyfatal("getting current directory failed: "
-                                          "%s", isc_result_totext(result));
-
-               if (strlen(absolute_conffile) + strlen(ns_g_conffile) + 1 >
-                   sizeof(absolute_conffile))
-                       ns_main_earlyfatal("configuration filename too long: "
-                                          "%s%s", absolute_conffile,
-                                          ns_g_conffile);
-
-               strcat(absolute_conffile, ns_g_conffile);
-
+                       ns_main_earlyfatal("could not construct absolute path of "
+                                          "configuration file: %s", 
+                                          isc_result_totext(result));
                ns_g_conffile = absolute_conffile;
        }