projects
/
dockapps
/
dockbatmon.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dff7224
)
Improve error handling
author
Hugo Villeneuve
<hugo@hugovil.com>
Sat, 28 Feb 2015 22:36:21 +0000
(17:36 -0500)
committer
Hugo Villeneuve
<hugo@hugovil.com>
Sun, 2 Jan 2022 22:43:17 +0000
(17:43 -0500)
src/batmon.c
patch
|
blob
|
history
diff --git
a/src/batmon.c
b/src/batmon.c
index
c8781e1
..
d4aa03a
100644
(file)
--- a/
src/batmon.c
+++ b/
src/batmon.c
@@
-76,6
+76,9
@@
static void read_ac_status(void)
if (ac_file == NULL) {
perror(ac_file_path);
+ fprintf(stderr,
+ "Unable to find power supply AC online status.\n");
+ exit(EXIT_FAILURE);
} else {
while (!feof(ac_file)) {
memset(ac_file_line, 0, 40);
@@
-106,6
+109,9
@@
static void read_battery_status(void)
if (batt_file == NULL) {
perror(batt_file_path);
+ fprintf(stderr,
+ "Unable to determine battery capacity.\n");
+ exit(EXIT_FAILURE);
} else {
while (!feof(batt_file)) {
memset(batt_file_line, 0, 40);