Chore (Linux): code cleanup

This commit is contained in:
李通洲
2024-10-15 21:43:41 +08:00
parent ae76d2d032
commit 67a35c92ff
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ static bool detectDebianDerived(FFOSResult* result)
ffStrbufSetS(&result->idLike, "debian");
return true;
}
else if (ffPathExists("/usr/bin/pveversion", FF_PATHTYPE_FILE))
else if (access("/usr/bin/pveversion", X_OK) == 0)
{
ffStrbufSetS(&result->id, "pve");
ffStrbufSetS(&result->idLike, "debian");
+2 -2
View File
@@ -66,7 +66,7 @@ static uint32_t getMacPortsPackages()
return countMacPortsPackages(FASTFETCH_TARGET_DIR_ROOT "/opt/local");
}
static uint32_t getNixPackagesImpl(char* path)
static uint32_t getNixPackagesImpl(const char* path)
{
//Nix detection is kinda slow, so we only do it if the dir exists
if(!ffPathExists(path, FF_PATHTYPE_DIRECTORY))
@@ -87,7 +87,7 @@ static uint32_t getNixPackagesImpl(char* path)
NULL
});
return (uint32_t) strtol(output.chars, NULL, 10);
return (uint32_t) strtoul(output.chars, NULL, 10);
}
static uint32_t getNixPackages(FFstrbuf* baseDir, const char* dirname)