Skip to content

Commit 77e396d

Browse files
committed
std: treat ENOMEM as transient in the pidfd support probe
1 parent 22c9087 commit 77e396d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • library/std/src/sys/process/unix

library/std/src/sys/process/unix/unix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ impl Command {
510510
support = SPAWN;
511511
}
512512
}
513-
Err(e) if matches!(e.raw_os_error(), Some(libc::EMFILE | libc::ENFILE)) => {
514-
// We're temporarily(?) out of file descriptors. In this case pidfd_spawnp would also fail
513+
Err(e) if matches!(e.raw_os_error(), Some(libc::EMFILE | libc::ENFILE | libc::ENOMEM)) => {
514+
// We're temporarily(?) out of file descriptors or memory. In this case pidfd_spawnp would also fail
515515
// Don't update the support flag so we can probe again later.
516516
return Err(e)
517517
}

0 commit comments

Comments
 (0)