Commit e2a5909
committed
ext/pcntl: fix pcntl_setns() error handling.
Save errno into a local int before calling close(fd), as close() may
clobber errno on failure. Use int rather than errno_t because errno_t
is defined in C11 Annex K (bounds-checking interfaces) which is
optional and not widely implemented — many platforms (Linux/glibc,
musl, macOS, FreeBSD) do not provide it.
close GH-212561 parent 70b2761 commit e2a5909
2 files changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1584 | 1584 | | |
1585 | 1585 | | |
1586 | 1586 | | |
1587 | | - | |
| 1587 | + | |
1588 | 1588 | | |
1589 | 1589 | | |
1590 | 1590 | | |
| |||
1610 | 1610 | | |
1611 | 1611 | | |
1612 | 1612 | | |
| 1613 | + | |
1613 | 1614 | | |
1614 | 1615 | | |
1615 | 1616 | | |
1616 | | - | |
1617 | | - | |
| 1617 | + | |
| 1618 | + | |
1618 | 1619 | | |
1619 | 1620 | | |
1620 | 1621 | | |
| |||
1624 | 1625 | | |
1625 | 1626 | | |
1626 | 1627 | | |
1627 | | - | |
| 1628 | + | |
1628 | 1629 | | |
1629 | 1630 | | |
1630 | 1631 | | |
1631 | | - | |
| 1632 | + | |
1632 | 1633 | | |
1633 | 1634 | | |
1634 | 1635 | | |
| |||
0 commit comments