Skip to content

Commit

Permalink
delete duplicate files from queue
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrissou committed Aug 13, 2024
1 parent 429341b commit d15817d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Binary file modified .DS_Store
Binary file not shown.
9 changes: 0 additions & 9 deletions fuzzer/src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,6 @@ impl Queue {
.all(|(i, elem)| (*elem == 0) || self.bit_to_inputs.contains_key(&i))
{
//If file was created for this entry, delete it.
match fs::remove_file(format!(
"{}/outputs/queue/id:{:06},time:{},er:{:?}",
self.work_dir, item.id, item.timestamp, item.exitreason
)) {
Err(ref err) if err.kind() != ErrorKind::NotFound => {
println!("Error while deleting file: {}", err);
}
_ => {}
}
return;
}

Expand Down
12 changes: 12 additions & 0 deletions fuzzer/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ impl FuzzingState {
))
.expect("Could not create queue entry, are you sure $workdir/outputs exists?");
input.tree.unparse_to(&ctx, &mut file);

// Delete the original file.
match fs::remove_file(format!(
"{}/outputs/queue/id:{:06},time:{},er:{:?}",
&self.config.path_to_workdir, input.id, input.timestamp, input.exitreason
)) {
Err(ref err) if err.kind() != ErrorKind::NotFound => {
println!("Error while deleting file: {}", err);
}
_ => {}
}

return Ok(true);
}

Expand Down

0 comments on commit d15817d

Please sign in to comment.