mirror of
https://github.com/gechandesu/runcmd.git
synced 2026-06-02 21:28:04 +03:00
Revert "fix: Temporary disable WaitStatus core dump, continued and stopped states handling due https://github.com/vlang/v/issues/27098 bug"
This reverts commit 7390af4699.
This commit is contained in:
@@ -76,20 +76,19 @@ pub fn (s ProcessState) str() string {
|
|||||||
sig_str := os.sigint_to_signal_name(sig)
|
sig_str := os.sigint_to_signal_name(sig)
|
||||||
str = 'signal: ${sig} (${sig_str})'
|
str = 'signal: ${sig} (${sig_str})'
|
||||||
}
|
}
|
||||||
// s.status.stopped() {
|
s.status.stopped() {
|
||||||
// str = 'stop signal: ${s.status.stop_signal()}'
|
str = 'stop signal: ${s.status.stop_signal()}'
|
||||||
// }
|
}
|
||||||
// s.status.continued() {
|
s.status.continued() {
|
||||||
// str = 'continued'
|
str = 'continued'
|
||||||
// }
|
}
|
||||||
else {
|
else {
|
||||||
str = 'unknown'
|
str = 'unknown'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if s.status.coredump() {
|
||||||
// if s.status.coredump() {
|
str += ' (core dumped)'
|
||||||
// str += ' (core dumped)'
|
}
|
||||||
// }
|
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
module runcmd
|
module runcmd
|
||||||
|
|
||||||
// fn C.WIFSTOPPED(i32) bool
|
@[trusted]
|
||||||
|
fn C.WIFSTOPPED(int) bool
|
||||||
|
|
||||||
// fn C.WCOREDUMP(i32) bool
|
@[trusted]
|
||||||
|
fn C.WCOREDUMP(int) bool
|
||||||
|
|
||||||
// fn C.WIFCONTINUED(i32) bool
|
@[trusted]
|
||||||
|
fn C.WIFCONTINUED(int) bool
|
||||||
|
|
||||||
// fn C.WSTOPSIG(i32) int
|
@[trusted]
|
||||||
|
fn C.WSTOPSIG(int) int
|
||||||
|
|
||||||
// WaitStatus stores the result value of [wait(2)](https://www.man7.org/linux/man-pages/man2/wait.2.html) syscall.
|
// WaitStatus stores the result value of [wait(2)](https://www.man7.org/linux/man-pages/man2/wait.2.html) syscall.
|
||||||
pub type WaitStatus = int
|
pub type WaitStatus = u32
|
||||||
|
|
||||||
// exited returns true if process is exited.
|
// exited returns true if process is exited.
|
||||||
pub fn (w WaitStatus) exited() bool {
|
pub fn (w WaitStatus) exited() bool {
|
||||||
@@ -37,29 +41,29 @@ pub fn (w WaitStatus) term_signal() int {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
// // stopped returns true if the child process was stopped by delivery of a signal.
|
// stopped returns true if the child process was stopped by delivery of a signal.
|
||||||
// pub fn (w WaitStatus) stopped() bool {
|
pub fn (w WaitStatus) stopped() bool {
|
||||||
// return C.WIFSTOPPED(w)
|
return C.WIFSTOPPED(w)
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // stop_signal returns the number of the signal which caused the child to stop.
|
// stop_signal returns the number of the signal which caused the child to stop.
|
||||||
// pub fn (w WaitStatus) stop_signal() int {
|
pub fn (w WaitStatus) stop_signal() int {
|
||||||
// if w.stopped() {
|
if w.stopped() {
|
||||||
// return C.WSTOPSIG(w)
|
return C.WSTOPSIG(w)
|
||||||
// }
|
}
|
||||||
// return -1
|
return -1
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // continued returns true if the child process was resumed by delivery of SIGCONT.
|
// continued returns true if the child process was resumed by delivery of SIGCONT.
|
||||||
// pub fn (w WaitStatus) continued() bool {
|
pub fn (w WaitStatus) continued() bool {
|
||||||
// return C.WIFCONTINUED(w)
|
return C.WIFCONTINUED(w)
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // coredump returns true if the child produced a core dump.
|
// coredump returns true if the child produced a core dump.
|
||||||
// // See [core(5)](https://man7.org/linux/man-pages/man5/core.5.html).
|
// See [core(5)](https://man7.org/linux/man-pages/man5/core.5.html).
|
||||||
// pub fn (w WaitStatus) coredump() bool {
|
pub fn (w WaitStatus) coredump() bool {
|
||||||
// if w.signaled() {
|
if w.signaled() {
|
||||||
// return C.WCOREDUMP(w)
|
return C.WCOREDUMP(w)
|
||||||
// }
|
}
|
||||||
// return false
|
return false
|
||||||
// }
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user