mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-19 00:48:43 +09:00
use standard O_NONBLOCK naming
Systems define O_NONBLOCK & O_NDELAY as the same thing. POSIX however only defines O_NONBLOCK. Rename the current define to be portable. Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
ecea5b6052
commit
3526e02dee
@@ -257,8 +257,8 @@ int ssh_getpass(const char *prompt,
|
||||
}
|
||||
|
||||
/* disable nonblocking I/O */
|
||||
if (fd & O_NDELAY) {
|
||||
ok = fcntl(0, F_SETFL, fd & ~O_NDELAY);
|
||||
if (fd & O_NONBLOCK) {
|
||||
ok = fcntl(0, F_SETFL, fd & ~O_NONBLOCK);
|
||||
if (ok < 0) {
|
||||
perror("fcntl");
|
||||
return -1;
|
||||
@@ -273,7 +273,7 @@ int ssh_getpass(const char *prompt,
|
||||
}
|
||||
|
||||
/* close fd */
|
||||
if (fd & O_NDELAY) {
|
||||
if (fd & O_NONBLOCK) {
|
||||
ok = fcntl(0, F_SETFL, fd);
|
||||
if (ok < 0) {
|
||||
perror("fcntl");
|
||||
|
||||
Reference in New Issue
Block a user