mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-30 17:17:21 -04:00
Merge pull request #1906 from sehraf/pr_fix_unix_fcntl_nonblock
Fix unix_fcntl_nonblock() to not overwrite any existing flags.
This commit is contained in:
commit
680d9cde85
1 changed files with 3 additions and 2 deletions
|
@ -413,9 +413,10 @@ int unix_fcntl_nonblock(int fd)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/******************* WINDOWS SPECIFIC PART ******************/
|
/******************* OS SPECIFIC PART ******************/
|
||||||
#ifndef WINDOWS_SYS // ie UNIX
|
#ifndef WINDOWS_SYS // ie UNIX
|
||||||
ret = fcntl(fd, F_SETFL, O_NONBLOCK);
|
int flags = fcntl(fd, F_GETFL);
|
||||||
|
ret = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
||||||
|
|
||||||
#ifdef NET_DEBUG
|
#ifdef NET_DEBUG
|
||||||
std::cerr << "unix_fcntl_nonblock():" << ret << " errno:" << errno << std::endl;
|
std::cerr << "unix_fcntl_nonblock():" << ret << " errno:" << errno << std::endl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue