=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh.c,v retrieving revision 1.504 retrieving revision 1.505 diff -u -r1.504 -r1.505 --- src/usr.bin/ssh/ssh.c 2019/06/14 04:13:58 1.504 +++ src/usr.bin/ssh/ssh.c 2019/06/28 13:35:04 1.505 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.504 2019/06/14 04:13:58 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.505 2019/06/28 13:35:04 deraadt Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -747,7 +747,7 @@ break; case 'i': p = tilde_expand_filename(optarg, getuid()); - if (stat(p, &st) < 0) + if (stat(p, &st) == -1) fprintf(stderr, "Warning: Identity file %s " "not accessible: %s.\n", p, strerror(errno)); @@ -1405,8 +1405,8 @@ if (config == NULL) { r = snprintf(buf, sizeof buf, "%s%s%s", pw->pw_dir, strcmp(pw->pw_dir, "/") ? "/" : "", _PATH_SSH_USER_DIR); - if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) - if (mkdir(buf, 0700) < 0) + if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) == -1) + if (mkdir(buf, 0700) == -1) error("Could not create directory '%.200s'.", buf); } @@ -1566,7 +1566,7 @@ control_persist_detach(); debug("forking to background"); fork_after_authentication_flag = 0; - if (daemon(1, 1) < 0) + if (daemon(1, 1) == -1) fatal("daemon() failed: %.200s", strerror(errno)); } @@ -1662,8 +1662,8 @@ debug3("%s: %s:%d", __func__, options.stdio_forward_host, options.stdio_forward_port); - if ((in = dup(STDIN_FILENO)) < 0 || - (out = dup(STDOUT_FILENO)) < 0) + if ((in = dup(STDIN_FILENO)) == -1 || + (out = dup(STDOUT_FILENO)) == -1) fatal("channel_connect_stdio_fwd: dup() in/out failed"); if ((c = channel_connect_stdio_fwd(ssh, options.stdio_forward_host, options.stdio_forward_port, in, out)) == NULL) @@ -1816,7 +1816,7 @@ out = dup(STDOUT_FILENO); err = dup(STDERR_FILENO); - if (in < 0 || out < 0 || err < 0) + if (in == -1 || out == -1 || err == -1) fatal("dup() in/out/err failed"); /* enable nonblocking unless tty */ @@ -1947,7 +1947,7 @@ if ((devnull = open(_PATH_DEVNULL, O_WRONLY)) == -1) error("%s: open %s: %s", __func__, _PATH_DEVNULL, strerror(errno)); - if (dup2(devnull, STDOUT_FILENO) < 0) + if (dup2(devnull, STDOUT_FILENO) == -1) fatal("%s: dup2() stdout failed", __func__); if (devnull > STDERR_FILENO) close(devnull); @@ -2134,7 +2134,7 @@ int status; while ((pid = waitpid(-1, &status, WNOHANG)) > 0 || - (pid < 0 && errno == EINTR)) + (pid == -1 && errno == EINTR)) ; errno = save_errno; }