summaryrefslogtreecommitdiff
path: root/init/src/pid_one.rs
blob: e4034adc8f19d39b590fe3ae74e3632e5c0e7b3e (plain)
1
2
3
4
5
6
7
8
9
10
use std::process::id;

pub fn check_pid() -> Result<(), Box<dyn std::error::Error>> {
    let pid = id();

    match pid {
        1 => Ok(()),
        _ => Err(format!("Current PID: {}", pid).into()),
    }
}