diff options
author | Frederic Barrat <fbarrat@linux.ibm.com> | 2021-06-11 20:25:49 +0200 |
---|---|---|
committer | Frederic Barrat <fbarrat@linux.ibm.com> | 2021-06-11 20:25:49 +0200 |
commit | 85548f619e01629ca66b0b7087fab223e91fef59 (patch) | |
tree | 5d8d6bd833759aeca2c0bf8623aad5ad45a39466 | |
parent | 97a12b3caef7d059566a76f98631ed3176afdc03 (diff) |
Fix test compilation
We had a problem with the redefinition of _POSIX_C_SOURCE, which is
set in libocxl_internal.h. It needs to be defined before including
system header files.
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
-rw-r--r-- | unittests/unittests.c | 6 | ||||
-rw-r--r-- | unittests/virtocxl.c | 5 |
2 files changed, 3 insertions, 8 deletions
diff --git a/unittests/unittests.c b/unittests/unittests.c index 8d67358..6f45de4 100644 --- a/unittests/unittests.c +++ b/unittests/unittests.c @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "libocxl_internal.h" #include <unistd.h> #include <string.h> #include <stdlib.h> @@ -24,14 +25,9 @@ #include <pthread.h> #include <signal.h> #include <fcntl.h> - #include <misc/ocxl.h> - -#include "libocxl_internal.h" #include "static.h" -#include <stdlib.h> - static const char *ocxl_sysfs_path = "/tmp/ocxl-test"; static const char *ocxl_dev_path = "/dev/ocxl-test"; diff --git a/unittests/virtocxl.c b/unittests/virtocxl.c index c00f1fc..a918b70 100644 --- a/unittests/virtocxl.c +++ b/unittests/virtocxl.c @@ -14,10 +14,10 @@ * limitations under the License. */ +#include "libocxl_internal.h" #include <fuse/cuse_lowlevel.h> #include <fuse/fuse_lowlevel.h> #include <linux/poll.h> -#include "libocxl_internal.h" #include <misc/ocxl.h> #include <errno.h> #include <sys/types.h> @@ -26,7 +26,6 @@ #include <string.h> #include <unistd.h> #include <pthread.h> - #include <stdlib.h> typedef struct ocxl_kernel_event_header ocxl_kernel_event_header; @@ -193,7 +192,7 @@ bool afu_is_attached() { * @return the thread for the device, or 0 on error */ pthread_t create_ocxl_device(const char *afu_name, size_t global_mmio_size, size_t per_pasid_mmio_size) { - char sysfs_base[PATH_MAX]; + char sysfs_base[PATH_MAX - 20]; char tmp[PATH_MAX]; char buf[BUF_SIZE]; |