907 |
ASSERT(pidfile); |
ASSERT(pidfile); |
908 |
|
|
909 |
if( (ctime= get_timestamp(pidfile, S_IFREG)) ) { |
if( (ctime= get_timestamp(pidfile, S_IFREG)) ) { |
910 |
|
|
911 |
time_t now= time(&now); |
time_t now= time(&now); |
912 |
time_t since= now-ctime; |
time_t since= now-ctime; |
913 |
|
|
914 |
return get_uptime(since,sep); |
return get_uptime(since, sep); |
915 |
|
|
916 |
} |
} |
917 |
|
|
918 |
return xstrdup(""); |
return xstrdup(""); |
919 |
|
|
920 |
} |
} |
921 |
|
|
922 |
|
|
947 |
p+= snprintf(p, STRLEN-(p-buf),"%ldh%s", rest_h,sep); |
p+= snprintf(p, STRLEN-(p-buf),"%ldh%s", rest_h,sep); |
948 |
delta-= rest_h*hour; |
delta-= rest_h*hour; |
949 |
} |
} |
950 |
|
|
951 |
rest_m= delta/min; |
rest_m= delta/min; |
952 |
p+= snprintf(p, STRLEN-(p-buf),"%ldm%s", rest_m,sep); |
p+= snprintf(p, STRLEN-(p-buf),"%ldm%s", rest_m,sep); |
953 |
delta-= rest_m*min; |
delta-= rest_m*min; |
1085 |
return xstrdup("\r\n"); |
return xstrdup("\r\n"); |
1086 |
} |
} |
1087 |
|
|
1088 |
auth= xcalloc(sizeof(char *), STRLEN+1); |
auth= xcalloc(sizeof(char), STRLEN+1); |
1089 |
snprintf(auth, STRLEN, "Authorization: Basic %s\r\n", b64); |
snprintf(auth, STRLEN, "Authorization: Basic %s\r\n", b64); |
1090 |
free(b64); |
free(b64); |
1091 |
|
|