- chdir(PREFIX);
- log_module(MAIN_LOG, LOG_INFO, "changed to %s\n", PREFIX);
+ if (!chdir(PREFIX))
+ log_module(MAIN_LOG, LOG_INFO, "changed to %s\n", PREFIX);
+ else
+ log_module(MAIN_LOG, LOG_WARNING, "unable to change directory to %s, using current directory instead\n", PREFIX);