mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 23:35:21 +00:00
socket-tcp-skip-in-flight: Use set_nonblock
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
This commit is contained in:
committed by
Andrei Vagin
parent
635db4895a
commit
fd9fb7d339
@@ -30,7 +30,6 @@ int main(int argc, char **argv)
|
|||||||
struct pollfd poll_set[1];
|
struct pollfd poll_set[1];
|
||||||
int port = 9990;
|
int port = 9990;
|
||||||
int fd_s, fd_c, fd;
|
int fd_s, fd_c, fd;
|
||||||
int flags;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
test_init(argc, argv);
|
test_init(argc, argv);
|
||||||
@@ -39,9 +38,8 @@ int main(int argc, char **argv)
|
|||||||
if (fd_s < 0)
|
if (fd_s < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
flags = fcntl(fd_s, F_GETFL, 0);
|
if (set_nonblock(fd_s, true)) {
|
||||||
if (fcntl(fd_s, F_SETFL, flags | O_NONBLOCK)) {
|
pr_perror("setting O_NONBLOCK failed");
|
||||||
pr_perror("Unable to set O_NONBLOCK");
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user