summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-06-12 23:41:06 +1000
committerDarren Tucker <dtucker@zip.com.au>2007-06-12 23:41:06 +1000
commit43ce902449abc553e570af717a5eafe689150381 (patch)
tree92358863a48a813de93e392b79d3902b7064d7b7 /scp.c
parent8f6d0ed60eb0d790564a5f47ba63c9bc3c734058 (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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/scp.c b/scp.c
index a52aaeb12..087e64a42 100644
--- a/scp.c
+++ b/scp.c
@@ -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) {
602syserr: run_err("%s: %s", name, strerror(errno)); 602syserr: 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;