version 1.55, 2005/06/17 02:44:33 |
version 1.55.2.1, 2006/02/03 03:01:57 |
|
|
size_t bufsiz; |
size_t bufsiz; |
con *c = &fdcon[s]; |
con *c = &fdcon[s]; |
|
|
bufsiz = sizeof(buf); |
for (;;) { |
cp = buf; |
memset(buf, '\0', sizeof(buf)); |
while (bufsiz-- && (n = atomicio(read, s, cp, 1)) == 1 && *cp != '\n') { |
bufsiz = sizeof(buf); |
if (*cp == '\r') |
cp = buf; |
*cp = '\n'; |
while (bufsiz-- && |
cp++; |
(n = atomicio(read, s, cp, 1)) == 1 && *cp != '\n') { |
|
if (*cp == '\r') |
|
*cp = '\n'; |
|
cp++; |
|
} |
|
if (n != 1 || strncmp(buf, "SSH-", 4) == 0) |
|
break; |
} |
} |
if (n == 0) { |
if (n == 0) { |
switch (errno) { |
switch (errno) { |
|
|
extern char *optarg; |
extern char *optarg; |
|
|
TAILQ_INIT(&tq); |
TAILQ_INIT(&tq); |
|
|
|
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ |
|
sanitise_stdfd(); |
|
|
if (argc <= 1) |
if (argc <= 1) |
usage(); |
usage(); |