mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-capture: fix set_fd_blocking()
It was missing an include for the define and the variable was flat out wrong when porting. Fixes: #124
This commit is contained in:
@ -58,6 +58,7 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
@ -140,7 +141,7 @@ set_fd_blocking (int fd)
|
|||||||
{
|
{
|
||||||
#ifdef F_GETFL
|
#ifdef F_GETFL
|
||||||
long fcntl_flags;
|
long fcntl_flags;
|
||||||
fcntl_flags = fcntl (peer_fd, F_GETFL);
|
fcntl_flags = fcntl (fd, F_GETFL);
|
||||||
|
|
||||||
if (fcntl_flags == -1)
|
if (fcntl_flags == -1)
|
||||||
return false;
|
return false;
|
||||||
@ -151,7 +152,7 @@ set_fd_blocking (int fd)
|
|||||||
fcntl_flags &= ~O_NDELAY;
|
fcntl_flags &= ~O_NDELAY;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fcntl (peer_fd, F_SETFL, fcntl_flags) == -1)
|
if (fcntl (fd, F_SETFL, fcntl_flags) == -1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user