1
0
Fork 0

remove newlines from warn() in swap_*(), those functions already print a newline after printing string stderr

This commit is contained in:
raiz 2016-12-27 19:07:19 +03:00
parent e1c5476291
commit 6cab2d5719

View file

@ -443,7 +443,7 @@ swap_free(void)
buf[bytes_read] = '\0'; buf[bytes_read] = '\0';
fclose(fp); fclose(fp);
if (bytes_read == 0 || bytes_read == sizeof(buf)) { if (bytes_read == 0 || bytes_read == sizeof(buf)) {
warn("Failed to read /proc/meminfo\n"); warn("Failed to read from /proc/meminfo");
return smprintf(UNKNOWN_STR); return smprintf(UNKNOWN_STR);
} }
@ -477,7 +477,7 @@ swap_perc(void)
buf[bytes_read] = '\0'; buf[bytes_read] = '\0';
fclose(fp); fclose(fp);
if (bytes_read == 0 || bytes_read == sizeof(buf)) { if (bytes_read == 0 || bytes_read == sizeof(buf)) {
warn("Failed to read /proc/meminfo\n"); warn("Failed to read from /proc/meminfo");
return smprintf(UNKNOWN_STR); return smprintf(UNKNOWN_STR);
} }
@ -514,7 +514,7 @@ swap_total(void)
buf[bytes_read] = '\0'; buf[bytes_read] = '\0';
fclose(fp); fclose(fp);
if (bytes_read == 0 || bytes_read == sizeof(buf)) { if (bytes_read == 0 || bytes_read == sizeof(buf)) {
warn("Failed to read /proc/meminfo\n"); warn("Failed to read from /proc/meminfo");
return smprintf(UNKNOWN_STR); return smprintf(UNKNOWN_STR);
} }
@ -545,7 +545,7 @@ swap_used(void)
buf[bytes_read] = '\0'; buf[bytes_read] = '\0';
fclose(fp); fclose(fp);
if (bytes_read == 0 || bytes_read == sizeof(buf)) { if (bytes_read == 0 || bytes_read == sizeof(buf)) {
warn("Failed to read /proc/meminfo\n"); warn("Failed to read from /proc/meminfo");
return smprintf(UNKNOWN_STR); return smprintf(UNKNOWN_STR);
} }