1 diff --git a/src/Makevars b/src/Makevars
2 index 713b44c..704ac17 100644
6 RHDF5_LIBS = $(shell "$(R_HOME)/bin${R_ARCH_BIN}/Rscript" -e 'Rhdf5lib::pkgconfig("PKG_C_LIBS")')
7 -PKG_LIBS = $(RHDF5_LIBS)
8 +PKG_LIBS = $(RHDF5_LIBS) -lhdf5
12 diff --git a/src/h5testLock.c b/src/h5testLock.c
13 index b326444..5d58b4a 100644
14 --- a/src/h5testLock.c
15 +++ b/src/h5testLock.c
16 @@ -8,16 +8,16 @@ SEXP _h5fileLock(SEXP _file_name) {
19 /* create the temporary file */
20 - fd = HDopen(file_name, O_RDWR | O_CREAT | O_TRUNC, 0666);
21 + fd = open(file_name, O_RDWR | O_CREAT | O_TRUNC, 0666);
23 /* try to lock file */
24 - lk = HDflock(fd, LOCK_EX | LOCK_NB);
25 + lk = flock(fd, LOCK_EX | LOCK_NB);
27 /* unlock so we can remove */
28 - HDflock(fd, LOCK_UN);
35 /* return value of lock attempt */
36 PROTECT(Rval = allocVector(INTSXP, 1));
37 diff --git a/src/h5testLock.h b/src/h5testLock.h
38 index 2c1c5e4..25914ff 100644
39 --- a/src/h5testLock.h
40 +++ b/src/h5testLock.h
45 -#include <H5private.h>