diff options
author | davide <davide@FreeBSD.org> | 2013-05-04 14:03:18 +0000 |
---|---|---|
committer | davide <davide@FreeBSD.org> | 2013-05-04 14:03:18 +0000 |
commit | 49171951e3c2ee391cc14135ca9389ecb4e38f47 (patch) | |
tree | 58f50a43b89521ebbbf95593be5439c98bbdde90 /contrib/smbfs/lib | |
parent | 6473a2540f9533d31ae4872e4485cd1f7eb2e402 (diff) | |
download | FreeBSD-src-49171951e3c2ee391cc14135ca9389ecb4e38f47.zip FreeBSD-src-49171951e3c2ee391cc14135ca9389ecb4e38f47.tar.gz |
Completely rewrite the interface to smbdev switching from dev_clone
to cdevpriv(9). This commit changes the semantic of mount_smbfs
in userland as well, which now passes file descriptor in order to
to mount a specific filesystem istance.
Reviewed by: attilio, ed
Tested by: martymac
Diffstat (limited to 'contrib/smbfs/lib')
-rw-r--r-- | contrib/smbfs/lib/smb/ctx.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/contrib/smbfs/lib/smb/ctx.c b/contrib/smbfs/lib/smb/ctx.c index 0709b6b..c7b3ecab 100644 --- a/contrib/smbfs/lib/smb/ctx.c +++ b/contrib/smbfs/lib/smb/ctx.c @@ -602,40 +602,12 @@ smb_ctx_gethandle(struct smb_ctx *ctx) int fd, i; char buf[20]; - /* - * First, try to open as cloned device - */ fd = open("/dev/"NSMB_NAME, O_RDWR); if (fd >= 0) { ctx->ct_fd = fd; return 0; } - /* - * well, no clone capabilities available - we have to scan - * all devices in order to get free one - */ - for (i = 0; i < 1024; i++) { - snprintf(buf, sizeof(buf), "/dev/%s%d", NSMB_NAME, i); - fd = open(buf, O_RDWR); - if (fd >= 0) { - ctx->ct_fd = fd; - return 0; - } - } - /* - * This is a compatibility with old /dev/net/nsmb device - */ - for (i = 0; i < 1024; i++) { - snprintf(buf, sizeof(buf), "/dev/net/%s%d", NSMB_NAME, i); - fd = open(buf, O_RDWR); - if (fd >= 0) { - ctx->ct_fd = fd; - return 0; - } - if (errno == ENOENT) - return ENOENT; - } - return ENOENT; + return ENOENT; } int |