From: Carsten Leonhardt Date: Tue, 29 Jan 2019 15:29:07 +0000 (+0100) Subject: Fix rwlock_test unittest bug #2449 X-Git-Tag: Release-9.4.2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=738cac3bf86912ac1dd26d7b46d9c83f789c7207;p=thirdparty%2Fbacula.git Fix rwlock_test unittest bug #2449 Only call thr_setconcurrency if it's available. Fix order of linking and installation. --- diff --git a/bacula/src/lib/Makefile.in b/bacula/src/lib/Makefile.in index 8c4796ea1..a73cd9aa0 100644 --- a/bacula/src/lib/Makefile.in +++ b/bacula/src/lib/Makefile.in @@ -185,8 +185,8 @@ workq_test: Makefile workq.c rwlock_test: Makefile rwlock.c $(RMF) rwlock.o $(CXX) -DTEST_RWLOCK $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c - $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) $@ $(DESTDIR)$(sbindir)/ $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ rwlock.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS) + $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) $@ $(DESTDIR)$(sbindir)/ $(RMF) rwlock.o $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c diff --git a/bacula/src/lib/rwlock.c b/bacula/src/lib/rwlock.c index 539751192..cad04b4c1 100644 --- a/bacula/src/lib/rwlock.c +++ b/bacula/src/lib/rwlock.c @@ -445,7 +445,10 @@ int main (int argc, char *argv[]) * For Solaris 2.5,2.6,7 and 8 threads are not timesliced. * Ensure our threads can run concurrently. */ + +#ifdef USE_THR_SETCONCURRENCY thr_setconcurrency(THREADS); /* Only implemented on Solaris */ +#endif /* * Initialize the shared data.