Skip to content

Commit 9e1f34e

Browse files
committed
sh: change function name
1 parent 524b874 commit 9e1f34e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

sh/src/builtin/read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn read_until_from_non_blocking_fd(
8181
}
8282
}
8383
// might receive signals while reading
84-
shell.update_global_state();
84+
shell.handle_async_events();
8585
std::thread::sleep(Duration::from_millis(16));
8686
}
8787
if !buffer.is_empty() {

sh/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn standard_repl(shell: &mut Shell) {
140140
flush_stdout();
141141
}
142142
std::thread::sleep(Duration::from_millis(16));
143-
shell.update_global_state();
143+
shell.handle_async_events();
144144
if shell.set_options.vi {
145145
return;
146146
}
@@ -205,7 +205,7 @@ fn vi_repl(shell: &mut Shell) {
205205
flush_stdout()
206206
}
207207
std::thread::sleep(Duration::from_millis(16));
208-
shell.update_global_state();
208+
shell.handle_async_events();
209209
if !shell.set_options.vi {
210210
return;
211211
}

sh/src/shell/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ impl Shell {
219219
return Ok(signal_to_exit_status(signal));
220220
}
221221
WaitStatus::StillAlive => {
222-
self.update_global_state();
222+
self.handle_async_events();
223223
std::thread::sleep(Duration::from_millis(16));
224224
}
225225
_ => unreachable!(),
226226
}
227227
}
228228
}
229229

230-
pub fn update_global_state(&mut self) {
230+
pub fn handle_async_events(&mut self) {
231231
self.process_signals();
232232
if self.set_options.monitor {
233233
if let Err(err) = self.background_jobs.update_jobs() {
@@ -770,7 +770,7 @@ impl Shell {
770770
// same session as the shell process
771771
while getpgid(Some(child)).unwrap().as_raw() as u32 == getgid().as_raw() {
772772
// loop until child is process group leader
773-
self.update_global_state();
773+
self.handle_async_events();
774774
std::thread::sleep(Duration::from_millis(16));
775775
}
776776
// should never fail as stdin is a valid file descriptor and

0 commit comments

Comments
 (0)