aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssh
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2000-06-03 09:20:19 +0000
committerKris Kennaway <kris@FreeBSD.org>2000-06-03 09:20:19 +0000
commit48fb0b1aa92d6882739b8e8c8b83919e726157e8 (patch)
treed5f61da62d59764d33d557c7116a1a408e4599a9 /crypto/openssh
parente347aadd857d990d8ad21fbff6a6cc090b8a9599 (diff)
parent87e372b8a2a153de5bb26d9c63440f02c16ab39c (diff)
downloadsrc-48fb0b1aa92d6882739b8e8c8b83919e726157e8.tar.gz
src-48fb0b1aa92d6882739b8e8c8b83919e726157e8.zip
This commit was generated by cvs2svn to compensate for changes in r61206,
which included commits to RCS files with non-trunk default branches.
Notes
Notes: svn path=/head/; revision=61207
Diffstat (limited to 'crypto/openssh')
-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 000000000000..899142da7167
--- /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));
+}