Skip to content

Commit

Permalink
Use libc's ESRCH constant for ensure_default_route_with_gateway()
Browse files Browse the repository at this point in the history
  • Loading branch information
karencfv committed Jan 15, 2024
1 parent 6109d43 commit c565a24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion illumos-utils/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use crate::zone::ROUTE;
use crate::{execute, inner, output_to_exec_error, ExecutionError, PFEXEC};
use libc::ESRCH;
use std::net::Ipv6Addr;

/// Wraps commands for interacting with routing tables.
Expand Down Expand Up @@ -39,7 +40,7 @@ impl Route {
// If the entry is not found in the table,
// the exit status of the command will be 3 (ESRCH).
// When that is the case, we'll add the route.
Some(3) => {
Some(ESRCH) => {
let mut cmd = std::process::Command::new(PFEXEC);
let cmd = cmd.args(&[
ROUTE,
Expand Down

0 comments on commit c565a24

Please sign in to comment.