#include "config.h"
struct config config;
-char bbs_home_directory[PATH_MAX] = BBSDIR;
+char ctdl_home_directory[PATH_MAX] = CTDLDIR;
int home_specified = 0;
/*
FILE *cfp;
struct stat st;
- if (chdir(home_specified ? bbs_home_directory : BBSDIR) != 0) {
+ if (chdir(home_specified ? ctdl_home_directory : CTDLDIR) != 0) {
fprintf(stderr,
"This program could not be started.\n"
"Unable to change directory to %s\n"
"Error: %s\n",
- (home_specified ? bbs_home_directory : BBSDIR),
+ (home_specified ? ctdl_home_directory : CTDLDIR),
strerror(errno));
exit(1);
}
- cfp = fopen("citadel.config", "rb");
+ cfp = fopen(
+#ifndef HAVE_ETC_DIR
+ "."
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", "rb");
if (cfp == NULL) {
fprintf(stderr, "This program could not be started.\n"
"Unable to open %s/citadel.config\n"
"Error: %s\n",
- (home_specified ? bbs_home_directory : BBSDIR),
+ (home_specified ? ctdl_home_directory : CTDLDIR),
strerror(errno));
exit(1);
}
exit(1);
}
#ifndef __CYGWIN__
- if (st.st_uid != BBSUID || st.st_mode != (S_IFREG | S_IRUSR | S_IWUSR)) {
+ if (st.st_uid != CTDLUID || st.st_mode != (S_IFREG | S_IRUSR | S_IWUSR)) {
fprintf(stderr, "check the permissions on citadel.config\n");
exit(1);
}
{
FILE *cfp;
- if ((cfp = fopen("citadel.config", "rb+")) == NULL)
+ if ((cfp = fopen(
+#ifndef HAVE_ETC_DIR
+ "."
+#else
+ ETC_DIR
+#endif
+ "/citadel.config", "rb+")) == NULL)
perror("citadel.config");
else {
fwrite((char *) &config, sizeof(struct config), 1, cfp);