Files
haikuports/dev-libs/capstone/patches/capstone5-5.0.1.patchset

47 lines
1.1 KiB
Plaintext

From 017eec6bc39e0e76b4b4ee271d04dc6a89869690 Mon Sep 17 00:00:00 2001
From: Calvin Hill <calvin@hakobaito.co.uk>
Date: Sun, 13 Jan 2019 00:39:39 +0000
Subject: Fix build of fuzztests.
diff --git a/suite/fuzz/driverbin.c b/suite/fuzz/driverbin.c
index d5e3a0f..d59aae9 100644
--- a/suite/fuzz/driverbin.c
+++ b/suite/fuzz/driverbin.c
@@ -3,6 +3,7 @@
#include <stdio.h>
#include <dirent.h>
#include <unistd.h>
+#include <sys/stat.h>
#include "platform.h"
@@ -15,6 +16,7 @@ int main(int argc, char** argv)
size_t Size;
DIR *d;
struct dirent *dir;
+ struct stat s;
int r = 0;
int i;
@@ -35,9 +37,16 @@ int main(int argc, char** argv)
while((dir = readdir(d)) != NULL) {
//opens the file, get its size, and reads it into a buffer
+ #ifndef __HAIKU__
if (dir->d_type != DT_REG) {
continue;
}
+ else
+ stat(dir->d_name, &s);
+ if(!S_ISREG(s.st_mode)){
+ continue;
+ }
+ #endif
printf("Running file %s ", dir->d_name);
fflush(stdout);
fp = fopen(dir->d_name, "rb");
--
2.37.3