[pisa-src] r1049 - trunk/pisand

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Thu, 08 Oct 2009 12:32:24 +0200

Author: tjansen
Date: Thu Oct  8 12:32:24 2009
New Revision: 1049

Log:
Do not load config from the current directory in pisand. This commit is
similar to commit 707. Somehow pisand was forgotten...

Modified:
   trunk/pisand/ndconf.c

Modified: trunk/pisand/ndconf.c
==============================================================================
--- trunk/pisand/ndconf.c       Thu Oct  8 12:19:24 2009        (r1048)
+++ trunk/pisand/ndconf.c       Thu Oct  8 12:32:24 2009        (r1049)
@@ -79,30 +79,10 @@
  */
 void ndconf_setup_conffile(nd_conf *ndconf)
 {
-       char    *pwd, *pisand_pwd;
-       char    pwdconf[MAX_PATH];
-
-       /* Set the current working directory */
-       if ((pwd = getenv("PWD")))
-               pisand_pwd = strdup(pwd);
-       else
-               pisand_pwd = '\0';
-
-       snprintf((char *)pwdconf, sizeof(pwdconf), "%s/%s", pisand_pwd, 
PISAND_CONFFILE);
-
-       /* Determine the right location of the configuration file,
-        * and read the entire configurations from that file
-        */
+       /* Use default path if no config file was given via commandline 
argument */
        if (ndconf->conffile[0] == '\0') {
-
-               /* If a conf file exists in PWD, get it.
-                * If not, get the default path. */
-               if (access((const char *)pwdconf, F_OK) == 0)
-                       PISA_STRNCPY(ndconf->conffile, (const char *)pwdconf, 
sizeof(ndconf->conffile));
-               else {
-                       pisa_check_and_create_dir(PISA_CONFDIR_PATH, 
DEFAULT_CONFIG_DIR_MODE);
-                       PISA_STRNCPY(ndconf->conffile, 
PISAND_CONFFILE_FULLPATH, sizeof(ndconf->conffile));
-               }
+               pisa_check_and_create_dir(PISA_CONFDIR_PATH, 
DEFAULT_CONFIG_DIR_MODE);
+               PISA_STRNCPY(ndconf->conffile, PISAND_CONFFILE_FULLPATH, 
sizeof(ndconf->conffile));
        }
 
        if (pisa_cfg_setup_file(ndconf->conffile) <= 0) {

Other related posts:

  • » [pisa-src] r1049 - trunk/pisand - Thomas Jansen