diff -r a1da58215b65 -r 4a624c071ca9 brewco/rdsession.c --- a/brewco/rdsession.c Thu Dec 17 22:45:54 2015 +0100 +++ b/brewco/rdsession.c Sun Dec 20 20:37:40 2015 +0100 @@ -26,6 +26,7 @@ #include "xutil.h" extern int debug; +extern char *etcpath; const char BREWSTEP[14][10] = { "NA", "INIT", "WAITSTART", "PREMASH", "MASHING", "IODINE", "REMOVE", "PREBOIL", "BOIL", "BOILDONE", "COOLING", "WHIRLPOOL", "CLEANUP", "DONE" }; @@ -138,13 +139,7 @@ /* * Now write the XML configuration */ - if (getenv((char *)"USER") == NULL) { - mypath = xstrcpy((char *)"/root"); - } else { - mypath = xstrcpy(getenv((char *)"HOME")); - } - mypath = xstrcat(mypath, (char *)"/.brewco/var/"); - mkdirs(mypath, 0755); + mypath = xstrcpy(etcpath); mypath = xstrcat(mypath, (char *)"brewing.xml"); if (debug) @@ -191,18 +186,10 @@ xmlNodePtr cur; xmlChar *key; - syslog(LOG_NOTICE, "HOME='%s' USER='%s' LOGNAME='%s'", MBSE_SS(getenv((char *)"HOME")), MBSE_SS(getenv((char *)"USER")), MBSE_SS(getenv((char *)"LOGNAME"))); - /* * Search config file */ - if (getenv((char *)"USER") == NULL) { - mypath = xstrcpy((char *)"/root"); - } else { - mypath = xstrcpy(getenv((char *)"HOME")); - } - mypath = xstrcat(mypath, (char *)"/.brewco/var/"); - mkdirs(mypath, 0755); + mypath = xstrcpy(etcpath); mypath = xstrcat(mypath, (char *)"brewing.xml"); /*