このコミットが含まれているのは:
haturatu 2024-06-25 20:39:38 +09:00
コミット 30c7268063
1個のファイルの変更11行の追加12行の削除

ファイルの表示

@ -5,17 +5,16 @@
#include <stdlib.h> #include <stdlib.h>
const char *display_storage() { const char *display_storage() {
const char *excode = run_command_s("zpool list 2>/dev/null || echo $?"); const char *excode = run_command_s("zpool list 2>/dev/null || echo $?");
if ( if ( excode != NULL && (strncmp(excode, "127", strlen("127")) == 0)) {
excode != NULL && (strncmp(excode, "127", strlen("127")) == 0)) { free((void *)excode);
free((void *)excode); return run_command_s("df -h | "
return run_command_s("df -h | " "awk '/^\\/dev\\// {printf \"%s: %s / %s, \", $1, $3, $2}' | "
"awk '/^\\/dev\\// {printf \"%s: %s / %s, \", $1, $3, $2}' | " "awk '{sub(/, $/, \"\"); print}'");
"awk '{sub(/, $/, \"\"); print}'"); }
}
free((void *)excode); free((void *)excode);
return run_command_s("zpool list | " return run_command_s("zpool list | "
"awk 'NR>1 {printf \"%s: %s / %s, \", $1, $3, $2}' | " "awk 'NR>1 {printf \"%s: %s / %s, \", $1, $3, $2}' | "
"awk '{sub(/, $/, \"\"); print}'"); "awk '{sub(/, $/, \"\"); print}'");
} }