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:
Mike Frysinger
2025-11-08 23:13:35 -05:00
committed by Jakub Jelen
parent ecea5b6052
commit 3526e02dee

View File

@@ -257,8 +257,8 @@ int ssh_getpass(const char *prompt,
} }
/* disable nonblocking I/O */ /* disable nonblocking I/O */
if (fd & O_NDELAY) { if (fd & O_NONBLOCK) {
ok = fcntl(0, F_SETFL, fd & ~O_NDELAY); ok = fcntl(0, F_SETFL, fd & ~O_NONBLOCK);
if (ok < 0) { if (ok < 0) {
perror("fcntl"); perror("fcntl");
return -1; return -1;
@@ -273,7 +273,7 @@ int ssh_getpass(const char *prompt,
} }
/* close fd */ /* close fd */
if (fd & O_NDELAY) { if (fd & O_NONBLOCK) {
ok = fcntl(0, F_SETFL, fd); ok = fcntl(0, F_SETFL, fd);
if (ok < 0) { if (ok < 0) {
perror("fcntl"); perror("fcntl");