summaryrefslogtreecommitdiff
path: root/wmiistatus.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael+x200@stapelberg.de>2009-01-09 00:13:18 +0100
committerMichael Stapelberg <michael+x200@stapelberg.de>2009-01-09 00:13:18 +0100
commit9b7963c4fc9e458e54e757cc9ee4499518fe4528 (patch)
treebc15b1666d323397f41256017ee9693c5a3edd6c /wmiistatus.c
parent513cfe8f1bb892eda973221477ce385f2ca4aca8 (diff)
Handle common errors without dying
Diffstat (limited to 'wmiistatus.c')
-rw-r--r--wmiistatus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wmiistatus.c b/wmiistatus.c
index 10b1b33..1c9360f 100644
--- a/wmiistatus.c
+++ b/wmiistatus.c
@@ -219,7 +219,7 @@ static char *get_battery_info() {
charging_status_t status = CS_DISCHARGING;
if ((fd = open(battery_path, O_RDONLY)) == -1)
- die("Could not open %s", battery_path);
+ return "No battery found";
memset(part, 0, sizeof(part));
(void)read(fd, buf, sizeof(buf));
@@ -368,7 +368,7 @@ static char *get_eth_info() {
(void)strcpy(ifr.ifr_name, eth_interface);
if ((err = ioctl(fd, SIOCETHTOOL, &ifr)) == 0)
ethspeed = (ecmd.speed == 65535 ? 0 : ecmd.speed);
- else write_error_to_statusbar("Could not get interface speed. Insufficient privileges?");
+ else get_ethspeed = false;
(void)close(fd);
}