mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-19 10:10:06 +02:00
48 lines
1.2 KiB
Plaintext
48 lines
1.2 KiB
Plaintext
From 12215d491664fab5e11d359edc70dcda513cc1f2 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 57eea2c..280a7a0 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>
|
|
|
|
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size);
|
|
|
|
@@ -13,6 +14,8 @@ int main(int argc, char** argv)
|
|
size_t Size;
|
|
DIR *d;
|
|
struct dirent *dir;
|
|
+ struct stat s;
|
|
+
|
|
int r = 0;
|
|
|
|
if (argc != 2) {
|
|
@@ -32,9 +35,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 %s\n", dir->d_name);
|
|
fp = fopen(dir->d_name, "rb");
|
|
if (fp == NULL) {
|
|
--
|
|
2.19.1
|
|
|