summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/util.c b/util.c
index 71808f14d..1a591a6f0 100644
--- a/util.c
+++ b/util.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: util.c,v 1.5 2000/09/07 20:27:55 deraadt Exp $ */ 1/* $OpenBSD: util.c,v 1.6 2000/10/27 07:32:19 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: util.c,v 1.5 2000/09/07 20:27:55 deraadt Exp $"); 28RCSID("$OpenBSD: util.c,v 1.6 2000/10/27 07:32:19 markus Exp $");
29 29
30#include "ssh.h" 30#include "ssh.h"
31 31
@@ -48,18 +48,15 @@ void
48set_nonblock(int fd) 48set_nonblock(int fd)
49{ 49{
50 int val; 50 int val;
51 if (isatty(fd)) {
52 /* do not mess with tty's */
53 debug("no set_nonblock for tty fd %d", fd);
54 return;
55 }
56 val = fcntl(fd, F_GETFL, 0); 51 val = fcntl(fd, F_GETFL, 0);
57 if (val < 0) { 52 if (val < 0) {
58 error("fcntl(%d, F_GETFL, 0): %s", fd, strerror(errno)); 53 error("fcntl(%d, F_GETFL, 0): %s", fd, strerror(errno));
59 return; 54 return;
60 } 55 }
61 if (val & O_NONBLOCK) 56 if (val & O_NONBLOCK) {
57 debug("fd %d IS O_NONBLOCK", fd);
62 return; 58 return;
59 }
63 debug("fd %d setting O_NONBLOCK", fd); 60 debug("fd %d setting O_NONBLOCK", fd);
64 val |= O_NONBLOCK; 61 val |= O_NONBLOCK;
65 if (fcntl(fd, F_SETFL, val) == -1) 62 if (fcntl(fd, F_SETFL, val) == -1)