$NetBSD: patch-ab,v 1.4 2004/12/03 12:15:54 adam Exp $ --- src/main.c.orig 2004-07-02 21:21:08.000000000 +0000 +++ src/main.c @@ -72,7 +72,7 @@ # define _POSIX_SOURCE 1 /* Solaris needs this */ #endif -extern char origbotname[], userfile[], botnetnick[]; +extern char origbotname[], userfile[], botnetnick[], tempdir[]; extern int dcc_total, conmask, cache_hit, cache_miss, max_logs, quick_logs; extern struct dcc_t *dcc; extern struct userrec *userlist; @@ -102,7 +102,7 @@ int con_chan = 0; /* Foreground: c int term_z = 0; /* Foreground: use the terminal as a partyline? */ int use_stderr = 1; /* Send stuff to stderr instead of logfiles? */ -char configfile[121] = "eggdrop.conf"; /* Default config file name */ +char configfile[121] = __PKG_SYSCONFDIR__ "eggdrop.conf"; /* Default config file name */ char pid_file[120]; /* Name of the pid file */ char helpdir[121] = "help/"; /* Directory of help files */ char textdir[121] = "text/"; /* Directory for text files */ @@ -726,6 +726,8 @@ int main(int argc, char **argv) } #endif + chdir(__PREFIX__ "/share/eggdrop"); + /* Initialise context list */ for (i = 0; i < 16; i++) Context; @@ -825,7 +827,8 @@ int main(int argc, char **argv) cache_miss = 0; cache_hit = 0; if (!pid_file[0]) - egg_snprintf(pid_file, sizeof pid_file, "pid.%s", botnetnick); + egg_snprintf(pid_file, sizeof pid_file, "%.100s/pid.%.32s", + tempdir, botnetnick); /* Check for pre-existing eggdrop! */ f = fopen(pid_file, "r");