Skip to content
  • Philip Withnall's avatar
    power: Fix exit status checking for the backlight helper program · 89938548
    Philip Withnall authored
    
    
    `g_spawn_check_exit_status()` operates on a *wait status* rather than an
    *exit status*. A wait status is what’s returned by `waitpid()`, and it’s
    a platform-specific combination of bits indicating whether the program
    exited gracefully, or crashed/signaled, and what value it returned
    from `main()` (if any). An exit status is the value returned from
    `main()` (so, zero for a successfully-exiting application).
    
    `g_spawn_check_exit_status()` has been deprecated since GLib 2.70
    because of its confusing naming.
    
    `g_subprocess_get_exit_status()` returns an exit status (so is named
    correctly), but we don’t actually have to use it because `GSubprocess`
    already provides an API which combines `g_subprocess_wait_async()` and
    `g_spawn_check_wait_status()`: `g_subprocess_wait_check_async()`.
    
    So just use that instead. It’s been available since GLib 2.40.
    
    Signed-off-by: default avatarPhilip Withnall <pwithnall@gnome.org>
    89938548