From c0eb27037cb9f1704fa4e862f2b5318728a700a7 Mon Sep 17 00:00:00 2001 From: TheDarkBug Date: Wed, 21 Jul 2021 22:45:16 +0200 Subject: [PATCH] Little fix for previous commit --- Makefile | 6 +++--- uwufetch.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7156df3..a143f03 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ NAME = uwufetch FILES = uwufetch.c CFLAGS = -O3 -CFLAGS_DEBUG = -Wall -Wextra -g -thread +CFLAGS_DEBUG = -Wall -Wextra -g -pthread ifeq ($(shell uname), Linux) PREFIX = /usr/bin LIBDIR = /usr/lib @@ -16,8 +16,8 @@ CC = cc MAN_COMPILER = pandoc ifeq ($(shell uname), FreeBSD) -CFLAGS += -D__FREEBSD__ -CFLAGS_DEBUG += -D__FREEBSD__ + CFLAGS += -D__FREEBSD__ + CFLAGS_DEBUG += -D__FREEBSD__ endif diff --git a/uwufetch.c b/uwufetch.c index 85ee0df..b9c81e8 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -378,7 +378,9 @@ void get_info() // os version, cpu and board info FILE *os_release = fopen("/etc/os-release", "r"); +#ifndef __FREEBSD__ FILE *cpuinfo = fopen("/proc/cpuinfo", "r"); +#endif FILE *host_model_info = fopen("/sys/devices/virtual/dmi/id/product_version", "r"); #ifdef __CYGWIN__ iscygwin = 1; @@ -400,10 +402,12 @@ void get_info() break; } } +#ifndef __FREEBSD__ while (fgets(line, sizeof(line), cpuinfo)) if (sscanf(line, "model name : %[^\n]", cpu_model)) break; sprintf(user, "%s", getenv("USER")); +#endif if (iscygwin == 0) fclose(os_release); }