diff options
Diffstat (limited to 'fastback.cpp')
-rw-r--r-- | fastback.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fastback.cpp b/fastback.cpp index 747566f..3597b8c 100644 --- a/fastback.cpp +++ b/fastback.cpp @@ -57,6 +57,7 @@ typedef std::string string; static const char fastback_name[] = "fastback"; +static const char fastback_config_file[] = "/etc/fastback.conf"; // These are command line options // if set they must be malloc'ed memory. @@ -82,11 +83,6 @@ static string fastback_tmpdir; -//static const char* fastback_default_URLDIR = "ftp://dropbox.redhat.com/incoming/"; -static const char* fastback_default_URLDIR = "ftp://indus.usersys.redhat.com/incoming"; - - - static size_t fastback_read(void *buffer, size_t size, size_t nmemb, void *userp) @@ -573,7 +569,7 @@ main(int argc, char** argv) exit(2); } - if (parse_config("/etc/fastback.conf")) + if (parse_config(fastback_config_file)) exit(2); if (fastback_conf_LOGFILE) @@ -589,13 +585,18 @@ main(int argc, char** argv) } } - if (!fastback_URLDIR) - fastback_URLDIR = strdup(fastback_default_URLDIR); + if (!fastback_URLDIR || !strcmp(fastback_URLDIR,"")) + { + fprintf(stderr, + "%s: error: URLDIR not set in: %s\n", + fastback_name, fastback_config_file); + exit(3); + } if (!readable(fastback_filename)) { string msg = fastback_name; - msg += ": error: could not open: "; + msg += ": error: could not read: "; msg += fastback_filename; perror(msg.c_str()); exit(3); |