summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-06-03 09:20:19 +0000
committerkris <kris@FreeBSD.org>2000-06-03 09:20:19 +0000
commit780d02839af90707e6c8e227c590b92483e3b348 (patch)
treebda391979a1d3f7713b64f6e877626b7d88b569f /crypto
parent784d209c4677c786c2acc3eb44d3040493795328 (diff)
parent585dc667de870922b14ce5a99c088c1a68de7934 (diff)
downloadFreeBSD-src-780d02839af90707e6c8e227c590b92483e3b348.zip
FreeBSD-src-780d02839af90707e6c8e227c590b92483e3b348.tar.gz
This commit was generated by cvs2svn to compensate for changes in r61206,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/openssh/aux.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/crypto/openssh/aux.c b/crypto/openssh/aux.c
new file mode 100644
index 0000000..899142d
--- /dev/null
+++ b/crypto/openssh/aux.c
@@ -0,0 +1,36 @@
+#include "includes.h"
+RCSID("$OpenBSD: aux.c,v 1.2 2000/05/17 09:47:59 markus Exp $");
+
+#include "ssh.h"
+
+char *
+chop(char *s)
+{
+ char *t = s;
+ while (*t) {
+ if(*t == '\n' || *t == '\r') {
+ *t = '\0';
+ return s;
+ }
+ t++;
+ }
+ return s;
+
+}
+
+void
+set_nonblock(int fd)
+{
+ int val;
+ val = fcntl(fd, F_GETFL, 0);
+ if (val < 0) {
+ error("fcntl(%d, F_GETFL, 0): %s", fd, strerror(errno));
+ return;
+ }
+ if (val & O_NONBLOCK)
+ return;
+ debug("fd %d setting O_NONBLOCK", fd);
+ val |= O_NONBLOCK;
+ if (fcntl(fd, F_SETFL, val) == -1)
+ error("fcntl(%d, F_SETFL, O_NONBLOCK): %s", fd, strerror(errno));
+}
OpenPOWER on IntegriCloud