aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/sftpcache.c
diff options
context:
space:
mode:
authorDan Cross <cross@gajendra.net>2020-01-10 14:44:21 +0000
committerDan Cross <cross@gajendra.net>2020-01-10 14:54:30 +0000
commitfa325e9b42b0bdfb48857d1958d9fb7ceac55151 (patch)
tree81d26256d152435135bcb1ae43121979a49f5f2b /src/cmd/sftpcache.c
parent77a0a5b5194d4441c86de097f2aae297cb75e2c2 (diff)
downloadplan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.gz
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.bz2
plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.zip
Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
Diffstat (limited to 'src/cmd/sftpcache.c')
-rw-r--r--src/cmd/sftpcache.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/cmd/sftpcache.c b/src/cmd/sftpcache.c
index 3f8ea165..b21e8a7e 100644
--- a/src/cmd/sftpcache.c
+++ b/src/cmd/sftpcache.c
@@ -5,9 +5,9 @@
*
* Stupid sftp bug: sftp invokes ssh, which always set O_NONBLOCK
* on 0, 1, and 2. Ssh inherits sftp's 2, so we can't use the output pipe
- * on fd 2, since it will get set O_NONBLOCK, sftp won't notice, and
+ * on fd 2, since it will get set O_NONBLOCK, sftp won't notice, and
* writes will be lost. So instead we use a separate pipe for errors
- * and consult it after each command. Assume the pipe buffer is
+ * and consult it after each command. Assume the pipe buffer is
* big enough to hold the error output.
*/
#include <u.h>
@@ -35,7 +35,7 @@ Brd(Biobuf *bin)
{
static char buf[1000];
int c, tot;
-
+
tot = 0;
while((c = Bgetc(bin)) >= 0 && tot<sizeof buf){
buf[tot++] = c;
@@ -59,7 +59,7 @@ int
readstr(int fd, char *a, int n)
{
int i;
-
+
for(i=0; i<n; i++){
if(read(fd, a+i, 1) != 1)
return -1;
@@ -76,7 +76,7 @@ doerrors(int fd)
{
char buf[100];
int n, first;
-
+
first = 1;
while((n = read(sftperr, buf, sizeof buf)) > 0){
if(debug){
@@ -106,7 +106,7 @@ main(int argc, char **argv)
char buf[200], cmd[1000], *q, *s;
char dir[100], ndir[100];
int p[2], px[2], pe[2], pid, ctl, nctl, fd, n;
-
+
notify(bell);
fmtinstall('H', encodefmt);
@@ -117,10 +117,10 @@ main(int argc, char **argv)
default:
usage();
}ARGEND
-
+
if(argc != 1)
usage();
-
+
if(pipe(p) < 0 || pipe(px) < 0 || pipe(pe) < 0)
sysfatal("pipe: %r");
pid = fork();
@@ -169,7 +169,7 @@ main(int argc, char **argv)
sysfatal("fork");
if(pid != 0)
exits(nil);
-
+
for(;;){
nctl = listen(dir, ndir);
if(nctl < 0)
@@ -215,4 +215,3 @@ main(int argc, char **argv)
close(fd);
}
}
-