mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +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 <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <pthread.h>
|
||||
#ifdef __linux__
|
||||
@ -140,7 +141,7 @@ set_fd_blocking (int fd)
|
||||
{
|
||||
#ifdef F_GETFL
|
||||
long fcntl_flags;
|
||||
fcntl_flags = fcntl (peer_fd, F_GETFL);
|
||||
fcntl_flags = fcntl (fd, F_GETFL);
|
||||
|
||||
if (fcntl_flags == -1)
|
||||
return false;
|
||||
@ -151,7 +152,7 @@ set_fd_blocking (int fd)
|
||||
fcntl_flags &= ~O_NDELAY;
|
||||
#endif
|
||||
|
||||
if (fcntl (peer_fd, F_SETFL, fcntl_flags) == -1)
|
||||
if (fcntl (fd, F_SETFL, fcntl_flags) == -1)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user