X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=blobdiff_plain;f=src%2Fpatplex.c;h=a0818d2bd68cee1d5951f9385167738656745b19;hp=13fa062e4aaaeb2486082fe69cd0d874340871b3;hb=518c678c21a99f4b148f3cb1f40afe8b51577082;hpb=5dbb9d482311d5130be2b7005d6ab21d12f435b4 diff --git a/src/patplex.c b/src/patplex.c index 13fa062..a0818d2 100644 --- a/src/patplex.c +++ b/src/patplex.c @@ -514,7 +514,7 @@ int main(int argc, char **argv) { int c; int nodef; - char *gcf; + char *gcf, *lcf; struct hthead *req; int fd; @@ -542,8 +542,14 @@ int main(int argc, char **argv) free(gcf); } } - if((lconfig = readconfig(argv[optind])) == NULL) { - flog(LOG_ERR, "could not read `%s'", argv[optind]); + if((strchr(lcf = argv[optind], '/')) == NULL) { + if((lcf = findstdconf(sprintf3("ashd/%s", lcf))) == NULL) { + flog(LOG_ERR, "could not find requested configuration file `%s'", argv[optind]); + exit(1); + } + } + if((lconfig = readconfig(lcf)) == NULL) { + flog(LOG_ERR, "could not read `%s'", lcf); exit(1); } signal(SIGCHLD, chldhandler); @@ -551,7 +557,7 @@ int main(int argc, char **argv) signal(SIGPIPE, sighandler); while(1) { if(reload) { - reloadconf(argv[optind]); + reloadconf(lcf); reload = 0; } if((fd = recvreq(0, &req)) < 0) {