Skip to content

Commit

Permalink
Merge pull request #5451 from freddy77/no_pci
Browse files Browse the repository at this point in the history
  • Loading branch information
psafont authored Mar 4, 2024
2 parents 34e92c9 + 221e86e commit 59dd2f3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ocaml/networkd/lib/network_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,15 @@ module Sysfs = struct

let get_pci_ids name =
let read_id_from path =
try
let l = read_one_line path in
(* trim 0x *)
String.sub l 2 (String.length l - 2)
with _ -> ""
let l = path |> Unixext.string_of_file |> String.trim in
(* trim 0x *)
String.sub l 2 (String.length l - 2)
in
( read_id_from (getpath name "device/vendor")
, read_id_from (getpath name "device/device")
)
try
( read_id_from (getpath name "device/vendor")
, read_id_from (getpath name "device/device")
)
with _ -> ("", "")

(** Returns the name of the driver for network device [dev] *)
let get_driver_name dev =
Expand Down

0 comments on commit 59dd2f3

Please sign in to comment.