You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: fork.rs
    path of file: ./repos/remote-pty/remote-pty-slave/src
    
    the code of the file until where you have to start completion: use remote_pty_common::log::debug;

use crate::{channel::close_
    
pub extern "C" fn fork_handler() {
    debug("process fork");

    if let Err(msg) = close_remote_channel() {
        debug(format!("failed to close remote channel: {}", msg));
        return;
    }

    let pre_fork_state = match clear_conf() {
        Ok(s) => s,
        Err(msg) => {
            debug(format!("failed to clear conf: {}", msg));
            return;
        }
    };

    remote_pty_init(pre_fork_state);

    debug("fork complete");
}