changeset 156 | 2898369b1cdc |
parent 145 | 63a5269fb113 |
155:a54dcc86addb | 156:2898369b1cdc |
---|---|
32 { |
32 { |
33 char buf[80]; |
33 char buf[80]; |
34 time_t now = time (NULL); |
34 time_t now = time (NULL); |
35 |
35 |
36 FILE *f = fopen ("/proc/uptime", "r"); |
36 FILE *f = fopen ("/proc/uptime", "r"); |
37 if (f == NULL) { |
|
38 perror ("FOPEN"); |
|
39 return EXIT_FAILURE; |
|
40 } |
|
37 if (fgets (buf, sizeof (buf), f) == NULL) { |
41 if (fgets (buf, sizeof (buf), f) == NULL) { |
38 perror ("FOPEN"); |
42 perror ("FOPEN"); |
39 exit (errno); |
43 exit (errno); |
40 } |
44 } |
41 |
45 |