thermferm/rdconfig.c

changeset 666
48cc8868f9f4
parent 645
49eb753a958b
child 675
825210ba2707
equal deleted inserted replaced
665:66fae54fa7ba 666:48cc8868f9f4
25 #include "pid.h" 25 #include "pid.h"
26 #include "futil.h" 26 #include "futil.h"
27 #include "xutil.h" 27 #include "xutil.h"
28 28
29 int debug = FALSE; 29 int debug = FALSE;
30 int foreground = FALSE;
30 sys_config Config; /* System configuration */ 31 sys_config Config; /* System configuration */
31 extern pthread_mutex_t mutexes[5]; 32 extern pthread_mutex_t mutexes[5];
32 33
33 #define MY_ENCODING "utf-8" 34 #define MY_ENCODING "utf-8"
34 35
479 mypath = xstrcat(mypath, (char *)"/.thermferm/etc/"); 480 mypath = xstrcat(mypath, (char *)"/.thermferm/etc/");
480 mkdirs(mypath, 0755); 481 mkdirs(mypath, 0755);
481 mypath = xstrcat(mypath, (char *)"thermferm.xml"); 482 mypath = xstrcat(mypath, (char *)"thermferm.xml");
482 483
483 if (debug) 484 if (debug)
484 fprintf(stdout, "Writing %s\n", mypath); 485 syslog(LOG_NOTICE, "Writing %s", mypath);
485 486
486 if ((fp = fopen(mypath, "w")) == NULL) { 487 if ((fp = fopen(mypath, "w")) == NULL) {
487 syslog(LOG_NOTICE, "could not rewrite %s", mypath); 488 syslog(LOG_NOTICE, "could not rewrite %s", mypath);
488 free(mypath); 489 free(mypath);
489 return 1; 490 return 1;

mercurial