1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-12 15:41:16 +03:00

Fix some compiler warnings

Covscan analyzer was used

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Norbert Pocs
2021-08-04 09:22:08 +02:00
committed by Jakub Jelen
parent 6daa95f9c1
commit 63f97a3d03
3 changed files with 22 additions and 4 deletions

View File

@@ -255,7 +255,11 @@ int ssh_getpass(const char *prompt,
/* disable nonblocking I/O */
if (fd & O_NDELAY) {
fcntl(0, F_SETFL, fd & ~O_NDELAY);
ok = fcntl(0, F_SETFL, fd & ~O_NDELAY);
if (ok < 0) {
perror("fcntl");
return -1;
}
}
ok = ssh_gets(prompt, buf, len, verify);
@@ -267,7 +271,11 @@ int ssh_getpass(const char *prompt,
/* close fd */
if (fd & O_NDELAY) {
fcntl(0, F_SETFL, fd);
ok = fcntl(0, F_SETFL, fd);
if (ok < 0) {
perror("fcntl");
return -1;
}
}
if (!ok) {