Browse code

- core_uptime returns the uptime as an int (previosuly it used a float) If someone is really concerned that his ser uptime will wrap arround after 136 years I might be persuaded to change it back :-)

Andrei Pelinescu-Onciul authored on 17/02/2006 17:03:49
Showing 1 changed files
... ...
@@ -163,7 +163,11 @@ static void core_uptime(rpc_t* rpc, void* c)
163 163
 	if (rpc->add(c, "{", &s) < 0) return;
164 164
 	rpc->struct_add(s, "s", "now", ctime(&now));
165 165
 	rpc->struct_add(s, "s", "up_since", up_since_ctime);
166
-	rpc->struct_add(s, "f", "uptime", difftime(now, up_since));
166
+	/* no need for a float here (unless you're concerned that your uptime)
167
+	rpc->struct_add(s, "f", "uptime",  difftime(now, up_since));
168
+	*/
169
+	/* on posix system we can substract time_t directly */
170
+	rpc->struct_add(s, "d", "uptime",  (int)(now-up_since));
167 171
 }
168 172
 
169 173