Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

FreeBSD improvement and compile warning fixes #723

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ACLOCAL_AMFLAGS = -I m4
JANSSON_CPPFLAGS= -I$(top_builddir)/compat/jansson-2.9/src -I$(top_srcdir)/compat/jansson-2.9/src

if WANT_USBUTILS
USBUTILS_CPPFLAGS = `pkg-config libusb-1.0 --libs --cflags`
USBUTILS_CPPFLAGS = `pkg-config libusb-1.0 --cflags`
else
USBUTILS_CPPFLAGS =
endif
Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ if test "x$has_winpthread" != xtrue; then
PTHREAD_LIBS=-lpthread
fi

# Does the system have a POSIX clock_nanosleep (which can be given a
# CLOCK_MONOTONIC argument, can I check for that here too)?
AC_CHECK_FUNCS(clock_nanosleep)

# Drivers that are designed to be run on dedicated hardware should set standalone to yes
# All drivers should prepend an x to the drivercount

Expand Down
2 changes: 1 addition & 1 deletion driver-hashfast.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ static void hfa_check_options(struct hashfast_info *info)
if (!opt_hfa_options)
return;

if (!info->op_name)
if (info->op_name[0] == '\0')
return;

maxlen = strlen(info->op_name);
Expand Down
7 changes: 5 additions & 2 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
#endif
#include <sched.h>

#if (defined(__FreeBSD__) || defined(__OpenBSD__))
# include <pthread_np.h>
#endif

#include "miner.h"
#include "elist.h"
#include "compat.h"
Expand Down Expand Up @@ -1444,8 +1448,7 @@ void cgtimer_sub(cgtimer_t *a, cgtimer_t *b, cgtimer_t *res)
}
#endif /* WIN32 */

#if defined(CLOCK_MONOTONIC) && !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(WIN32) /* Essentially just linux */
//#ifdef CLOCK_MONOTONIC /* Essentially just linux */
#if defined(CLOCK_MONOTONIC) && HAVE_CLOCK_NANOSLEEP /* Mostly just linux */
void cgtimer_time(cgtimer_t *ts_start)
{
clock_gettime(CLOCK_MONOTONIC, ts_start);
Expand Down