From 9d6f99d2e9ab3d601c8469d265d71541e2b328a0 Mon Sep 17 00:00:00 2001 From: TheDarkBug Date: Sat, 24 Jul 2021 15:37:16 +0200 Subject: [PATCH] Added host info for freebsd, fixed 104 --- uwufetch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/uwufetch.c b/uwufetch.c index 86a63a4..585aaaf 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -405,6 +405,12 @@ void get_info() #endif FILE *host_model_info = fopen("/sys/devices/virtual/dmi/id/board_name", "r"); if (!host_model_info) host_model_info = fopen("/sys/devices/virtual/dmi/id/product_name", "r"); +#ifdef __FREEBSD__ + host_model_info = popen("sysctl -a hw.hv_vendor", "r"); + while (fgets(line, sizeof(line), host_model_info)) + if (sscanf(line, "hw.hv_vendor: %[^\n]", host_model)) + break; +#endif FILE *host_model_version = fopen("/sys/devices/virtual/dmi/id/product_version", "r"); #ifdef __CYGWIN__ iscygwin = 1;