@@ -140,8 +140,8 @@ EXP_ST u8 skip_deterministic, /* Skip deterministic stages? */
140
140
deferred_mode , /* Deferred forkserver mode? */
141
141
fast_cal ; /* Try to calibrate faster? */
142
142
143
- static s32 out_fd , /* Persistent fd for out_file */
144
- dev_urandom_fd = -1 , /* Persistent fd for /dev/urandom */
143
+ // static s32 out_fd, /* Persistent fd for out_file */
144
+ static s32 dev_urandom_fd = -1 , /* Persistent fd for /dev/urandom */
145
145
dev_null_fd = -1 , /* Persistent fd for /dev/null */
146
146
fsrv_ctl_fd , /* Fork server control pipe (write) */
147
147
fsrv_st_fd ; /* Fork server status pipe (read) */
@@ -3116,12 +3116,13 @@ EXP_ST void init_forkserver(char** argv) {
3116
3116
3117
3117
dup2 (dev_null_fd , 0 );
3118
3118
3119
- } else {
3119
+ }
3120
+ //else {
3120
3121
3121
- dup2 (out_fd , 0 );
3122
- close (out_fd );
3122
+ // dup2(out_fd, 0);
3123
+ // close(out_fd);
3123
3124
3124
- }
3125
+ // }
3125
3126
3126
3127
/* Set up control and status pipes, close the unneeded original fds. */
3127
3128
@@ -3402,12 +3403,13 @@ static u8 run_target(char** argv, u32 timeout) {
3402
3403
3403
3404
dup2 (dev_null_fd , 0 );
3404
3405
3405
- } else {
3406
+ }
3407
+ //else {
3406
3408
3407
- dup2 (out_fd , 0 );
3408
- close (out_fd );
3409
+ // dup2(out_fd, 0);
3410
+ // close(out_fd);
3409
3411
3410
- }
3412
+ // }
3411
3413
3412
3414
/* On Linux, would be faster to use O_CLOEXEC. Maybe TODO. */
3413
3415
@@ -3559,26 +3561,7 @@ static u8 run_target(char** argv, u32 timeout) {
3559
3561
3560
3562
static void write_to_testcase (void * mem , u32 len ) {
3561
3563
3562
- s32 fd = out_fd ;
3563
-
3564
- if (out_file ) {
3565
-
3566
- unlink (out_file ); /* Ignore errors. */
3567
-
3568
- fd = open (out_file , O_WRONLY | O_CREAT | O_EXCL , 0600 );
3569
-
3570
- if (fd < 0 ) PFATAL ("Unable to create '%s'" , out_file );
3571
-
3572
- } else lseek (fd , 0 , SEEK_SET );
3573
-
3574
- ck_write (fd , mem , len , out_file );
3575
-
3576
- if (!out_file ) {
3577
-
3578
- if (ftruncate (fd , len )) PFATAL ("ftruncate() failed" );
3579
- lseek (fd , 0 , SEEK_SET );
3580
-
3581
- } else close (fd );
3564
+ //AFLNet sends data via network so it does not need this function
3582
3565
3583
3566
}
3584
3567
@@ -8925,19 +8908,19 @@ EXP_ST void setup_dirs_fds(void) {
8925
8908
8926
8909
/* Setup the output file for fuzzed data, if not using -f. */
8927
8910
8928
- EXP_ST void setup_stdio_file (void ) {
8929
-
8930
- u8 * fn = alloc_printf ("%s/.cur_input" , out_dir );
8931
-
8932
- unlink (fn ); /* Ignore errors */
8933
-
8934
- out_fd = open (fn , O_RDWR | O_CREAT | O_EXCL , 0600 );
8935
-
8936
- if (out_fd < 0 ) PFATAL ("Unable to create '%s'" , fn );
8937
-
8938
- ck_free (fn );
8939
-
8940
- }
8911
+ // EXP_ST void setup_stdio_file(void) {
8912
+ //
8913
+ // u8* fn = alloc_printf("%s/.cur_input", out_dir);
8914
+ //
8915
+ // unlink(fn); /* Ignore errors */
8916
+ //
8917
+ // out_fd = open(fn, O_RDWR | O_CREAT | O_EXCL, 0600);
8918
+ //
8919
+ // if (out_fd < 0) PFATAL("Unable to create '%s'", fn);
8920
+ //
8921
+ // ck_free(fn);
8922
+ //
8923
+ // }
8941
8924
8942
8925
8943
8926
/* Make sure that core dumps don't go to a program. */
@@ -9874,7 +9857,7 @@ int main(int argc, char** argv) {
9874
9857
9875
9858
detect_file_args (argv + optind + 1 );
9876
9859
9877
- if (!out_file ) setup_stdio_file ();
9860
+ // if (!out_file) setup_stdio_file();
9878
9861
9879
9862
check_binary (argv [optind ]);
9880
9863
0 commit comments