diff options
author | Darren Tucker <dtucker@zip.com.au> | 2007-06-12 23:41:06 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2007-06-12 23:41:06 +1000 |
commit | 43ce902449abc553e570af717a5eafe689150381 (patch) | |
tree | 92358863a48a813de93e392b79d3902b7064d7b7 /scp.c | |
parent | 8f6d0ed60eb0d790564a5f47ba63c9bc3c734058 (diff) | |
download | openssh-git-43ce902449abc553e570af717a5eafe689150381.tar.gz |
- djm@cvs.openbsd.org 2007/06/12 08:24:20
[scp.c]
make scp try to skip FIFOs rather than blocking when nothing is listening.
depends on the platform supporting sane O_NONBLOCK semantics for open
on FIFOs (apparently POSIX does not mandate this), which OpenBSD does.
bz #856; report by cjwatson AT debian.org; ok markus@
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: scp.c,v 1.156 2007/01/22 13:06:21 djm Exp $ */ +/* $OpenBSD: scp.c,v 1.157 2007/06/12 08:24:20 djm Exp $ */ /* * scp - secure remote copy. This is basically patched BSD rcp which * uses ssh to do the data transfer (instead of using rcmd). @@ -596,12 +596,13 @@ source(int argc, char **argv) name); goto next; } - if ((fd = open(name, O_RDONLY, 0)) < 0) + if ((fd = open(name, O_RDONLY|O_NONBLOCK, 0)) < 0) goto syserr; if (fstat(fd, &stb) < 0) { syserr: run_err("%s: %s", name, strerror(errno)); goto next; } + unset_nonblock(fd); switch (stb.st_mode & S_IFMT) { case S_IFREG: break; |