Fixed username and os name (openbsd)

This commit is contained in:
adri 2022-06-24 16:16:06 +02:00
parent 061563ef1d
commit e0d207ea08

View file

@ -933,7 +933,11 @@ struct info get_info()
#endif // _WIN32 #endif // _WIN32
// os version, cpu and board info // os version, cpu and board info
#ifdef __OPENBSD__
FILE* os_release = popen("echo ID=openbsd", "r"); // os-release does not exist in OpenBSD
#else
FILE* os_release = fopen("/etc/os-release", "r"); // os name file FILE* os_release = fopen("/etc/os-release", "r"); // os name file
#endif
#ifndef __BSD__ #ifndef __BSD__
FILE* cpuinfo = fopen("/proc/cpuinfo", "r"); // cpu name file for not-freebsd systems FILE* cpuinfo = fopen("/proc/cpuinfo", "r"); // cpu name file for not-freebsd systems
#else #else