Browse code

- publishing up_since as core variable

Tomas Mandys authored on 10/06/2008 15:03:35
Showing 3 changed files
... ...
@@ -177,7 +177,6 @@ static const char* dst_blst_stats_get_doc[] = {
177 177
 #define MAX_CTIME_LEN 128
178 178
 
179 179
 /* up time */
180
-static time_t up_since;
181 180
 static char up_since_ctime[MAX_CTIME_LEN];
182 181
 
183 182
 
... ...
@@ -646,7 +645,6 @@ rpc_export_t core_rpc_methods[] = {
646 646
 int rpc_init_time(void)
647 647
 {
648 648
 	char *t;
649
-	time(&up_since);
650 649
 	t=ctime(&up_since);
651 650
 	if (strlen(t)+1>=MAX_CTIME_LEN) {
652 651
 		ERR("Too long data %d\n", (int)strlen(t));
... ...
@@ -49,6 +49,7 @@ extern int config_check;
49 49
 extern char* stat_file;
50 50
 extern unsigned short port_no;
51 51
 
52
+extern time_t up_since;
52 53
 extern pid_t creator_pid;  /* pid of first process before daemonization */
53 54
 extern int uid;
54 55
 extern int gid;
... ...
@@ -294,6 +294,7 @@ int *process_count = 0;			/* Total number of SER processes currently
294 294
 gen_lock_t* process_lock;		/* lock on the process table */
295 295
 int process_no = 0;				/* index of process in the pt */
296 296
 
297
+time_t up_since;
297 298
 int sig_flag = 0;              /* last signal received */
298 299
 int dont_fork = 0;
299 300
 int dont_daemonize = 0;
... ...
@@ -1276,6 +1277,7 @@ int main(int argc, char** argv)
1276 1276
 	int dont_fork_cnt;
1277 1277
 
1278 1278
 	/*init*/
1279
+	time(&up_since);
1279 1280
 	creator_pid = getpid();
1280 1281
 	ret=-1;
1281 1282
 	my_argc=argc; my_argv=argv;