correct printing in code, suppress useless comments.

This commit is contained in:
primardj 2024-04-13 20:19:00 +01:00
parent 1bcbcc9082
commit 6d9fb61ef8
2 changed files with 3 additions and 16 deletions

View file

@ -29,25 +29,13 @@ pub fn sent_signal( svwait_var: i32, verbose: i8, command: &str, mut sv: status_
if command == "u" {
// case where command is up
if sv.sent_signal(b"u") == true {
println!("Tout c bien passé");
if sv.sent_signal(b"u") {
return 0;
} else {
println!("Ko Error panic tout ce que tu veux.");
return 1;
}
}
//let service = fs::OpenOptions::new().append(true).open("supervise/control");
//if ! service.is_ok() {
// println!("warning: {}: unable to append to supervise/control: file does not exist", sv.clone());
// return make_exit_code(exit_code);
//}
//let mut control = match service {
// Ok(file) => file,
// Err(..) => panic!("Shouln't goes there, the programmer is trash."),
//};
// TODO

View file

@ -108,7 +108,6 @@ pub fn sent_signal(signal: &[u8]) -> bool {
loop {
match tx.try_write(signal) {
Ok(..) => {
println!("write successful");
return true;
},
Err(e) if e.kind() == ErrorKind::WouldBlock => {
@ -116,10 +115,10 @@ pub fn sent_signal(signal: &[u8]) -> bool {
},
Err(e) => {
dbg!(e);
println!("Error while trying to sent command");
println!("Impossible Error while writing on pipe.");
return false;
},
}
};
};
},
Err(e) if e.raw_os_error() == Some(libc::ENXIO) => {