Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/uu/split/src/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,14 +1028,16 @@ impl ManageOutFiles for OutFiles {
// Could have hit system limit for open files.
// Try to close one previously instantiated writer first
for (i, out_file) in self.iter_mut().enumerate() {
if i != idx && out_file.maybe_writer.is_some() {
out_file.maybe_writer.as_mut().unwrap().flush()?;
out_file.maybe_writer = None;
out_file.is_new = false;
count += 1;

// And then try to instantiate the writer again
continue 'loop1;
if i != idx {
if let Some(writer) = out_file.maybe_writer.as_mut() {
writer.flush()?;
out_file.maybe_writer = None;
out_file.is_new = false;
count += 1;

// And then try to instantiate the writer again
continue 'loop1;
}
}
}

Expand Down
Loading