shared: fix nm_steal_fd() for handling zero file descriptor
Zero is a valid file descriptor.
Fixes: 956b3e8bd5
This commit is contained in:
@@ -1157,7 +1157,7 @@ nm_steal_fd (int *p_fd)
|
|||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if ( p_fd
|
if ( p_fd
|
||||||
&& ((fd = *p_fd) > 0)) {
|
&& ((fd = *p_fd) >= 0)) {
|
||||||
*p_fd = -1;
|
*p_fd = -1;
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user