Skip to content

Commit 8cc5442

Browse files
committed
fix GNUmakefile
1 parent bd94d5f commit 8cc5442

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

GNUmakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ ifeq "$(shell echo 'int main() { return 0;}' | $(CC) $(CFLAGS) -fsanitize=addres
211211
endif
212212

213213
ifdef ASAN_BUILD
214-
$(info Compiling ASAN version of binaries)
215-
CFLAGS+=$(ASAN_CFLAGS)
216-
LDFLAGS+=$(ASAN_LDFLAGS)
214+
$(info Compiling ASAN version of binaries)
215+
CFLAGS+=$(ASAN_CFLAGS)
216+
LDFLAGS+=$(ASAN_LDFLAGS)
217217
endif
218218

219219
ifeq "$(shell echo '$(HASH)include <sys/ipc.h>@$(HASH)include <sys/shm.h>@int main() { int _id = shmget(IPC_PRIVATE, 65536, IPC_CREAT | IPC_EXCL | 0600); shmctl(_id, IPC_RMID, 0); return 0;}' | tr @ '\n' | $(CC) $(CFLAGS) -x c - -o .test2 2>/dev/null && echo 1 || echo 0 ; rm -f .test2 )" "1"

src/afl-fuzz-init.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,16 +1383,18 @@ void setup_dirs_fds(afl_state_t *afl) {
13831383

13841384
}
13851385

1386-
/*
1387-
if (afl->is_master) {
1386+
/*
1387+
if (afl->is_master) {
13881388
1389-
u8 *x = alloc_printf("%s/is_master", afl->sync_dir);
1390-
int fd = open(x, O_CREAT | O_RDWR, 0644);
1391-
if (fd < 0) FATAL("cannot create %s", x);
1392-
close(fd);
1389+
u8 *x = alloc_printf("%s/%s/is_master", afl->sync_dir, afl->sync_id);
1390+
int fd = open(x, O_CREAT | O_RDWR, 0644);
1391+
if (fd < 0) FATAL("cannot create %s", x);
1392+
free(x);
1393+
close(fd);
13931394
1394-
}
1395-
*/
1395+
}
1396+
1397+
*/
13961398

13971399
if (mkdir(afl->out_dir, 0700)) {
13981400

src/afl-fuzz-run.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,20 @@ void sync_fuzzers(afl_state_t *afl) {
401401

402402
}
403403

404+
/*
405+
// a slave only syncs from a master, a master syncs from everyone
406+
if (likely(afl->is_slave)) {
407+
408+
u8 x = alloc_printf("%s/%s/is_master", afl->sync_dir, sd_ent->d_name);
409+
int res = access(x, F_OK);
410+
free(x);
411+
if (res != 0)
412+
continue;
413+
414+
}
415+
416+
*/
417+
404418
/* Skip anything that doesn't have a queue/ subdirectory. */
405419

406420
qd_path = alloc_printf("%s/%s/queue", afl->sync_dir, sd_ent->d_name);

0 commit comments

Comments
 (0)