$NetBSD$ Pre-processor macro SYSCONFDIR will be defined on the command line. SYSCONFDIR has to be a string enclosed by "" to enable string literal concatenation. --- file.c.orig 2007-01-03 10:31:01.000000000 +0100 +++ file.c @@ -145,9 +145,9 @@ time_t File_getTimestamp(char *object, m /** * Search the system for the monit control file. Try first ~/.monitrc, - * if that fails try /etc/monitrc, then /usr/local/etc/monitrc and - * finally ./monitrc. Exit the application if the control file was - * not found. + * if that fails try /etc/monitrc, then SYSCONFDIR/monitrc (default: + * /usr/local/etc/monitrc) and finally ./monitrc. + * Exit the application if the control file was not found. * @return The location of monits control file (monitrc) */ char *File_findControlFile() { @@ -164,7 +164,7 @@ char *File_findControlFile() { return (rcfile); } memset(rcfile, 0, STRLEN); - snprintf(rcfile, STRLEN, "/usr/local/etc/%s", MONITRC); + snprintf(rcfile, STRLEN, SYSCONFDIR "/%s", MONITRC); if(File_exist(rcfile)) { return (rcfile); } @@ -174,7 +174,7 @@ char *File_findControlFile() { return (rcfile); } LogError("%s: Cannot find the control file at " - "~/.%s, /etc/%s, /usr/local/etc/%s or at ./%s \n", + "~/.%s, /etc/%s, " SYSCONFDIR "/%s or at ./%s \n", prog, MONITRC, MONITRC, MONITRC, MONITRC); exit(1);