diff --git a/src/pty.c b/src/pty.c index e5d47ed..b046a6a 100644 --- a/src/pty.c +++ b/src/pty.c @@ -470,7 +470,7 @@ int pty_spawn(pty_process *process, pty_read_cb read_cb, pty_exit_cb exit_cb) { status = -errno; goto error; } - if (fcntl(master, F_SETFD, flags | O_NONBLOCK) == -1) { + if (fcntl(master, F_SETFL, flags | O_NONBLOCK) == -1) { status = -errno; goto error; } @@ -502,4 +502,4 @@ error: waitpid(pid, NULL, 0); return status; } -#endif \ No newline at end of file +#endif