File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -540,8 +540,9 @@ mod linux_impl {
540540 // - `errno` is read via `Error::last_os_error()` only on
541541 // the error branch and only on the same thread that
542542 // made the syscall, so the value is well-defined.
543- // nosemgrep: rust.lang.security.unsafe-usage.unsafe-usage
543+ // nosemgrep
544544 let raw_fd = unsafe {
545+ // nosemgrep
545546 nix:: libc:: socket (
546547 nix:: libc:: AF_NETLINK ,
547548 nix:: libc:: SOCK_DGRAM | nix:: libc:: SOCK_CLOEXEC ,
@@ -563,8 +564,7 @@ mod linux_impl {
563564 // raw fd is never used again as an integer after this
564565 // line. The `OwnedFd` will `close(2)` it on `Drop`,
565566 // satisfying the close-exactly-once invariant.
566- // nosemgrep: rust.lang.security.unsafe-usage.unsafe-usage
567- let fd = unsafe { OwnedFd :: from_raw_fd ( raw_fd) } ;
567+ let fd = unsafe { OwnedFd :: from_raw_fd ( raw_fd) } ; // nosemgrep
568568
569569 // pid=0 lets the kernel pick our netlink address;
570570 // groups=CN_IDX_PROC subscribes to the proc-event multicast
You can’t perform that action at this time.
0 commit comments