Module Name: src Committed By: pooka Date: Fri Oct 29 16:13:51 UTC 2010
Modified Files: src/usr.sbin/puffs/mount_psshfs: fs.c node.c psshfs.c Log Message: Make error message more userfriendly in cases where server does not support sftp. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/puffs/mount_psshfs/fs.c cvs rdiff -u -r1.61 -r1.62 src/usr.sbin/puffs/mount_psshfs/node.c \ src/usr.sbin/puffs/mount_psshfs/psshfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/puffs/mount_psshfs/fs.c diff -u src/usr.sbin/puffs/mount_psshfs/fs.c:1.22 src/usr.sbin/puffs/mount_psshfs/fs.c:1.23 --- src/usr.sbin/puffs/mount_psshfs/fs.c:1.22 Thu Apr 1 02:34:09 2010 +++ src/usr.sbin/puffs/mount_psshfs/fs.c Fri Oct 29 16:13:51 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fs.c,v 1.22 2010/04/01 02:34:09 pooka Exp $ */ +/* $NetBSD: fs.c,v 1.23 2010/10/29 16:13:51 pooka Exp $ */ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: fs.c,v 1.22 2010/04/01 02:34:09 pooka Exp $"); +__RCSID("$NetBSD: fs.c,v 1.23 2010/10/29 16:13:51 pooka Exp $"); #endif /* !lint */ #include <err.h> @@ -47,8 +47,6 @@ *(a4) = 0; \ rv = fname(a1, a2, a3, a4); \ if (rv || a4 == 0) { \ - fprintf(stderr, "psshfs_handshake failed %d (%s) %d\n", \ - rv, strerror(rv), *a4); \ return rv ? rv : EPROTO; \ } \ } while (/*CONSTCOND*/0) @@ -82,7 +80,7 @@ NULL, 0 }}; - + int psshfs_handshake(struct puffs_usermount *pu, int fd) { Index: src/usr.sbin/puffs/mount_psshfs/node.c diff -u src/usr.sbin/puffs/mount_psshfs/node.c:1.61 src/usr.sbin/puffs/mount_psshfs/node.c:1.62 --- src/usr.sbin/puffs/mount_psshfs/node.c:1.61 Thu Apr 1 02:34:09 2010 +++ src/usr.sbin/puffs/mount_psshfs/node.c Fri Oct 29 16:13:51 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: node.c,v 1.61 2010/04/01 02:34:09 pooka Exp $ */ +/* $NetBSD: node.c,v 1.62 2010/10/29 16:13:51 pooka Exp $ */ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -27,7 +27,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: node.c,v 1.61 2010/04/01 02:34:09 pooka Exp $"); +__RCSID("$NetBSD: node.c,v 1.62 2010/10/29 16:13:51 pooka Exp $"); #endif /* !lint */ #include <assert.h> @@ -362,8 +362,9 @@ *ncookies = 0; rv = sftp_readdir(pu, pctx, pn); - if (rv) + if (rv) { goto out; + } /* find next dirent */ for (i = *readoff;;i++) { Index: src/usr.sbin/puffs/mount_psshfs/psshfs.c diff -u src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.61 src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.62 --- src/usr.sbin/puffs/mount_psshfs/psshfs.c:1.61 Wed Feb 17 15:54:10 2010 +++ src/usr.sbin/puffs/mount_psshfs/psshfs.c Fri Oct 29 16:13:51 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: psshfs.c,v 1.61 2010/02/17 15:54:10 pooka Exp $ */ +/* $NetBSD: psshfs.c,v 1.62 2010/10/29 16:13:51 pooka Exp $ */ /* * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. @@ -41,7 +41,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: psshfs.c,v 1.61 2010/02/17 15:54:10 pooka Exp $"); +__RCSID("$NetBSD: psshfs.c,v 1.62 2010/10/29 16:13:51 pooka Exp $"); #endif /* !lint */ #include <sys/types.h> @@ -415,7 +415,7 @@ } if (psshfs_handshake(pu, *sshfd) != 0) - errx(1, "psshfs_handshake %d", which); + errx(1, "handshake failed, server does not support sftp?"); x = 1; if (ioctl(*sshfd, FIONBIO, &x) == -1) err(1, "nonblocking descriptor %d", which);