103 perror("cfgmgr_load_config: stat"); |
103 perror("cfgmgr_load_config: stat"); |
104 return -1; |
104 return -1; |
105 } |
105 } |
106 |
106 |
107 //printf("1 time: %d - %d\n", f->last_modified, s.st_mtim.tv_sec); |
107 //printf("1 time: %d - %d\n", f->last_modified, s.st_mtim.tv_sec); |
108 if(f->last_modified != s.st_mtim.tv_sec) { |
108 if(f->last_modified != s.st_mtime) { |
109 /* reload the file */ |
109 /* reload the file */ |
110 printf("reload: %s\n", f->file.ptr); |
110 printf("reload: %s\n", f->file.ptr); |
111 log_ereport( |
111 log_ereport( |
112 LOG_INFORM, |
112 LOG_INFORM, |
113 "reload configuration file: %s", |
113 "reload configuration file: %s", |
114 f->file.ptr); |
114 f->file.ptr); |
115 f->reload(f, conf); |
115 f->reload(f, conf); |
116 f->last_modified = s.st_mtim.tv_sec; |
116 f->last_modified = s.st_mtime; |
117 if(reload) { |
117 if(reload) { |
118 *reload = 1; |
118 *reload = 1; |
119 } |
119 } |
120 } |
120 } |
121 return 0; |
121 return 0; |