Skip to content

Commit 85548f6

Browse files
committed
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>
1 parent 97a12b3 commit 85548f6

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

unittests/unittests.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include "libocxl_internal.h"
1718
#include <unistd.h>
1819
#include <string.h>
1920
#include <stdlib.h>
@@ -24,14 +25,9 @@
2425
#include <pthread.h>
2526
#include <signal.h>
2627
#include <fcntl.h>
27-
2828
#include <misc/ocxl.h>
29-
30-
#include "libocxl_internal.h"
3129
#include "static.h"
3230

33-
#include <stdlib.h>
34-
3531
static const char *ocxl_sysfs_path = "/tmp/ocxl-test";
3632
static const char *ocxl_dev_path = "/dev/ocxl-test";
3733

unittests/virtocxl.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include "libocxl_internal.h"
1718
#include <fuse/cuse_lowlevel.h>
1819
#include <fuse/fuse_lowlevel.h>
1920
#include <linux/poll.h>
20-
#include "libocxl_internal.h"
2121
#include <misc/ocxl.h>
2222
#include <errno.h>
2323
#include <sys/types.h>
@@ -26,7 +26,6 @@
2626
#include <string.h>
2727
#include <unistd.h>
2828
#include <pthread.h>
29-
3029
#include <stdlib.h>
3130

3231
typedef struct ocxl_kernel_event_header ocxl_kernel_event_header;
@@ -193,7 +192,7 @@ bool afu_is_attached() {
193192
* @return the thread for the device, or 0 on error
194193
*/
195194
pthread_t create_ocxl_device(const char *afu_name, size_t global_mmio_size, size_t per_pasid_mmio_size) {
196-
char sysfs_base[PATH_MAX];
195+
char sysfs_base[PATH_MAX - 20];
197196
char tmp[PATH_MAX];
198197
char buf[BUF_SIZE];
199198

0 commit comments

Comments
 (0)