Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / r-modules / patches / rhdf5.patch
blob129a8a225f0d0eae182c5cbaa2ce3623e92aa438
1 diff --git a/src/Makevars b/src/Makevars
2 index 713b44c..704ac17 100644
3 --- a/src/Makevars
4 +++ b/src/Makevars
5 @@ -1,5 +1,5 @@
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
10 #PKG_CFLAGS = -Wall
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) {
17 int lk = -1;
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);
29 + flock(fd, LOCK_UN);
31 /* close */
32 - HDclose(fd);
33 + close(fd);
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
41 @@ -1,5 +1,5 @@
42 #include <fcntl.h>
43 +#include <unistd.h>
44 #include "myhdf5.h"
45 -#include <H5private.h>
47 SEXP _h5fileLock();