diff options
author | 諏訪子 <suwako@076.moe> | 2024-06-19 23:56:46 +0900 |
---|---|---|
committer | 諏訪子 <suwako@076.moe> | 2024-06-19 23:56:46 +0900 |
commit | fb2f5ff0a7f44a27b95bee6f755d4ed2add4d9fa (patch) | |
tree | 13b8cc53536c3c2929d38808fb4fd01955495604 /src | |
parent | b6e3f6cb5d1051777c35988f201e6730525e3389 (diff) |
ちんちん
Diffstat (limited to 'src')
-rw-r--r-- | src/cpu.c | 9 | ||||
-rw-r--r-- | src/packages.c | 2 |
2 files changed, 9 insertions, 2 deletions
@@ -1,6 +1,11 @@ #include "cpu.h" #include "common.h" +#if defined(__linux__) +#include <stdio.h> +#include <stdlib.h> +#endif + const char *display_cpu() { #if defined(__NetBSD__) return run_command_s("sysctl -n machdep.cpu_brand | sed 's/(R)//' | " @@ -28,7 +33,7 @@ const char *display_cpu() { if (fp == NULL) { perror("失敗"); - return; + return NULL; } if (fgets(buf, sizeof(buf), fp) != NULL) { @@ -38,7 +43,7 @@ const char *display_cpu() { } else { perror("失敗"); fclose(fp); - return; + return NULL; } fclose(fp); diff --git a/src/packages.c b/src/packages.c index 3505815..01fb8e2 100644 --- a/src/packages.c +++ b/src/packages.c @@ -18,5 +18,7 @@ const char *display_packages() { } else if (access("/usr/bin/dpkg-query", F_OK) != -1) { return run_command_s("dpkg-query -f '.\n' -W | wc -l | sed \"s/ //g\""); } + + return NULL; #endif } |