}
}
- if ((full_design == 1) || (remaining == -1))
+ if ((full_design == -1) || (remaining == -1)) {
+ OUTPUT_FULL_TEXT("No battery");
return;
+ }
(void)snprintf(statusbuf, sizeof(statusbuf), "%s",
(status == CS_CHARGING ? "CHR" :
size_t sysctl_size = sizeof(sysctl_rslt);
if (sysctlbyname(BATT_LIFE, &sysctl_rslt, &sysctl_size, NULL, 0) != 0) {
- printf("No battery");
+ OUTPUT_FULL_TEXT("No battery");
return;
}
present_rate = sysctl_rslt;
if (sysctlbyname(BATT_TIME, &sysctl_rslt, &sysctl_size, NULL, 0) != 0) {
- printf("No battery");
+ OUTPUT_FULL_TEXT("No battery");
return;
}
remaining = sysctl_rslt;
if (sysctlbyname(BATT_STATE, &sysctl_rslt, &sysctl_size, NULL,0) != 0) {
- printf("No battery");
+ OUTPUT_FULL_TEXT("No battery");
return;
}