From b6e3f6cb5d1051777c35988f201e6730525e3389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Wed, 19 Jun 2024 23:52:56 +0900 Subject: =?UTF-8?q?=E6=8E=83=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/host.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/host.c') diff --git a/src/host.c b/src/host.c index 03b2f2c..ee88778 100644 --- a/src/host.c +++ b/src/host.c @@ -6,8 +6,6 @@ #if defined(__linux__) #include - -int skip = 0; #endif const char *run_host_command(const char *command) { @@ -38,8 +36,7 @@ const char *run_host_command(const char *command) { strstr(buf, "INVALID") != NULL || strstr(buf, "All Series") != NULL ) { - skip = 1; - break; + return NULL; } #endif @@ -113,7 +110,7 @@ void display_host_model() { if (cmd2) { const char *model = run_host_command(cmd2); - if (!skip) printf(" %s", model); + if (model) printf(" %s", model); } #elif defined(__APPLE__) printf("%s", run_host_command("sysctl -n hw.model")); -- cgit v1.2.3