winpr/file: don't close stdin/stdout/stderr
If the handle is closed stdin/stdout/stderr should be left open.
This commit is contained in:
parent
8091530779
commit
0f5e7c60a7
@ -74,8 +74,13 @@ static BOOL FileCloseHandle(HANDLE handle) {
|
||||
|
||||
if (file->fd != -1)
|
||||
{
|
||||
close(file->fd);
|
||||
file->fd = -1;
|
||||
|
||||
/* Don't close stdin/stdout/stderr */
|
||||
if (file->fd > 2)
|
||||
{
|
||||
close(file->fd);
|
||||
file->fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
free(handle);
|
||||
|
@ -41,6 +41,7 @@ int TestFileGetStdHandle(int argc, char* argv[])
|
||||
fprintf(stderr, "write failed\n");
|
||||
return -1;
|
||||
}
|
||||
CloseHandle(stdout);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user