comparison src/syslog2iptables.cpp @ 48:ba0259c9e411 stable-1-0-11

Fixes to compile on Fedora 9 and for const correctness
author Carl Byington <carl@five-ten-sg.com>
date Thu, 29 May 2008 11:38:42 -0700
parents 9e9f09cf411c
children f133196b8591
comparison
equal deleted inserted replaced
47:a4861687fbd1 48:ba0259c9e411
45 45
46 46
47 //////////////////////////////////////////////// 47 ////////////////////////////////////////////////
48 // syslog a message 48 // syslog a message
49 // 49 //
50 void my_syslog(char *text) { 50 void my_syslog(const char *text) {
51 if (use_syslog) { 51 if (use_syslog) {
52 pthread_mutex_lock(&syslog_mutex); 52 pthread_mutex_lock(&syslog_mutex);
53 if (!syslog_opened) { 53 if (!syslog_opened) {
54 openlog("syslog2iptables", LOG_PID, LOG_AUTHPRIV); 54 openlog("syslog2iptables", LOG_PID, LOG_AUTHPRIV);
55 syslog_opened = true; 55 syslog_opened = true;
97 if (!loader_run) break; 97 if (!loader_run) break;
98 CONFIG &dc = *config; 98 CONFIG &dc = *config;
99 time_t then = dc.load_time; 99 time_t then = dc.load_time;
100 struct stat st; 100 struct stat st;
101 bool reload = false; 101 bool reload = false;
102 for (string_set::iterator i=dc.config_files.begin(); i!=dc.config_files.end(); i++) { 102 for (string_set::const_iterator i=dc.config_files.begin(); i!=dc.config_files.end(); i++) {
103 char *fn = *i; 103 const char *fn = *i;
104 if (stat(fn, &st)) reload = true; // file disappeared 104 if (stat(fn, &st)) reload = true; // file disappeared
105 else if (st.st_mtime > then) reload = true; // file modified 105 else if (st.st_mtime > then) reload = true; // file modified
106 if (reload) break; 106 if (reload) break;
107 } 107 }
108 if (reload) { 108 if (reload) {