Codebase list uptimed / d419900
Add Android/Linux support WHR 4 years ago
4 changed file(s) with 22 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1919 #include "../config.h"
2020 #include "urec.h"
2121
22 #ifdef __ANDROID__
23 Urec *u_current;
24 #endif
2225 Urec *urec_list = NULL;
2326 static Urec *urec_last = NULL;
2427
5353
5454 #include "misc.h"
5555
56 #ifdef __ANDROID__
57 #define FILE_BOOTID "/data/uptimed/bootid"
58 #define FILE_RECORDS "/data/uptimed/records"
59 #else
5660 #define FILE_BOOTID "/var/spool/uptimed/bootid"
5761 #define FILE_RECORDS "/var/spool/uptimed/records"
62 #endif
5863
5964 typedef struct urec {
6065 time_t utime; /* uptime */
2424 #define SYSWIDTH 24
2525 #define DOWNWIDTH 20
2626
27 #ifdef __ANDROID__
28 extern Urec *u_current;
29 #else
2730 Urec *u_current;
31 #endif
2832 time_t first, prev, tenth, second;
2933 int runas_cgi=0, show_max=10, show_milestone=0, layout=PRE, show_downtime=0, run_loop=0, update_interval=5;
3034 int sort_by=0, no_ansi=0, no_stats=0, no_current=0, wide_out=0;
489493 switch(i)
490494 {
491495 case '?':
496 #ifdef __ANDROID__
497 fputc('\n', stderr);
498 #endif
492499 print_help(argv);
493500 break;
494501 case 'a':
2828 #include <getopt.h>
2929 #endif
3030
31 #ifdef __ANDROID__
32 extern Urec *u_current;
33 #else
3134 Urec *u_current = NULL;
35 #endif
3236 int our_pos=0;
3337 int update_interval=60, create_bootid=0, send_email=0, foreground=0;
3438 time_t log_min_uptime = 0, mail_min_uptime = 0;
341345 switch(index)
342346 {
343347 case '?':
348 #ifdef __ANDROID__
349 fputc('\n', stderr);
350 #endif
344351 print_help(argv);
345352 break;
346353 case 'v':