OSDN Git Service

Update linux_functions.c
authorsu8 <coyim@nypato.com>
Sat, 18 Nov 2017 15:05:26 +0000 (17:05 +0200)
committerGitHub <noreply@github.com>
Sat, 18 Nov 2017 15:05:26 +0000 (17:05 +0200)
src/linux_functions.c

index 003b71a..0c58e1f 100644 (file)
@@ -351,7 +351,8 @@ get_battery(char *str1) {
     BATTERY_TOTAL(temp, num);
 
     if (NULL == (fp = fopen(temp, "r"))) {
-      exit_with_err(CANNOT_OPEN, "BAT0 and BAT1");
+      *str1++ = '0';
+      return;
     }
   }