Commit cf2806f
committed
uucore: fix getsid error handling
The previous implementation checked if Errno::last() was UnknownErrno
to determine success, but this is incorrect because errno is not
cleared on success. A previous syscall could have set errno to a value
like ENOENT, causing getsid to incorrectly report an error.
The correct pattern is to check if the result is -1, which is what
getsid returns on error per POSIX.1 parent 4f4fa08 commit cf2806f
1 file changed
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
77 | 75 | | |
78 | 76 | | |
79 | 77 | | |
| |||
0 commit comments