diff --git a/CMakeLists.txt b/CMakeLists.txt index 76624fd98..dc0d571dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -734,7 +734,7 @@ elseif(NetBSD) src/common/sysctl.c src/detection/battery/battery_nbsd.c src/detection/bios/bios_nbsd.c - src/detection/bluetooth/bluetooth_nosupport.c + src/detection/bluetooth/bluetooth_bsd.c src/detection/bluetoothradio/bluetoothradio_nosupport.c src/detection/board/board_nbsd.c src/detection/bootmgr/bootmgr_bsd.c @@ -1620,6 +1620,7 @@ elseif(OpenBSD) ) elseif(NetBSD) target_link_libraries(libfastfetch + PRIVATE "bluetooth" PRIVATE "m" PRIVATE "prop" ) diff --git a/src/detection/bluetooth/bluetooth_bsd.c b/src/detection/bluetooth/bluetooth_bsd.c index a9a752b0d..7425c614f 100644 --- a/src/detection/bluetooth/bluetooth_bsd.c +++ b/src/detection/bluetooth/bluetooth_bsd.c @@ -6,7 +6,13 @@ static int enumDev(FF_MAYBE_UNUSED int sockfd, struct bt_devinfo const* dev, FFlist* devices) { FFBluetoothResult* device = ffListAdd(devices); - ffStrbufInitS(&device->name, bt_devremote_name_gen(dev->devname, &dev->bdaddr)); + ffStrbufInitS(&device->name, + #if __FreeBSD__ + bt_devremote_name_gen(dev->devname, &dev->bdaddr) + #else + dev->devname + #endif + ); ffStrbufInitS(&device->address, bt_ntoa(&dev->bdaddr, NULL)); ffStrbufUpperCase(&device->address); ffStrbufInit(&device->type);