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) |
- 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 @@ | |||
1 | /* $OpenBSD: scp.c,v 1.156 2007/01/22 13:06:21 djm Exp $ */ | 1 | /* $OpenBSD: scp.c,v 1.157 2007/06/12 08:24:20 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * scp - secure remote copy. This is basically patched BSD rcp which | 3 | * scp - secure remote copy. This is basically patched BSD rcp which |
4 | * uses ssh to do the data transfer (instead of using rcmd). | 4 | * uses ssh to do the data transfer (instead of using rcmd). |
@@ -596,12 +596,13 @@ source(int argc, char **argv) | |||
596 | name); | 596 | name); |
597 | goto next; | 597 | goto next; |
598 | } | 598 | } |
599 | if ((fd = open(name, O_RDONLY, 0)) < 0) | 599 | if ((fd = open(name, O_RDONLY|O_NONBLOCK, 0)) < 0) |
600 | goto syserr; | 600 | goto syserr; |
601 | if (fstat(fd, &stb) < 0) { | 601 | if (fstat(fd, &stb) < 0) { |
602 | syserr: run_err("%s: %s", name, strerror(errno)); | 602 | syserr: run_err("%s: %s", name, strerror(errno)); |
603 | goto next; | 603 | goto next; |
604 | } | 604 | } |
605 | unset_nonblock(fd); | ||
605 | switch (stb.st_mode & S_IFMT) { | 606 | switch (stb.st_mode & S_IFMT) { |
606 | case S_IFREG: | 607 | case S_IFREG: |
607 | break; | 608 | break; |