0c4d1e6 process-util: explicitly handle processes lacking parents in get_process_ppid()

3 files Authored by Lennart Poettering 2 years ago, Committed by bluca 2 years ago,
    process-util: explicitly handle processes lacking parents in get_process_ppid()
    
    Let's make sure we signal out-of-band via an error message if a process
    doesn't have a parent process whose PID we could return. Otherwise we'll
    too likely hide errors, as we return an invalid PID 0, which in other
    contexts has special meaning (i.e. usually "myself").
    
    Replaces: #20153
    
    This is based on work by @dtardon, but goes a different route, by
    ensuring we propagate a proper error in this case.
    
    This modernizes the function in question a bit in other ways, i.e.
    renames stuff and makes the return parameter optional.
    
        
file modified
+18 -9
file modified
+11 -12
file modified
+43 -5