2011/10/22 Michael Tokarev <m...@tls.msk.ru>:
> On 22.10.2011 01:49, Robert Millan wrote:
>> tags 637082 patch
>> thanks
>>
>> Here's a patch that fixes this problem.
>
> Umm... where?  Did you forget to attach a file maybe?

Yes, sorry.  Here's the patch.

-- 
Robert Millan
=== modified file 'util-linux/xmount.c'
--- util-linux/xmount.c	2011-10-22 08:54:17 +0000
+++ util-linux/xmount.c	2011-10-22 08:59:14 +0000
@@ -7,6 +7,8 @@
 
 #elif defined(__FreeBSD_kernel__)
 
+#include <errno.h>
+
 static void build_iovec(struct iovec **iov, int *iovlen, const char *name,
 		void *val, size_t len)
 {
@@ -45,6 +47,9 @@ int FAST_FUNC xmount(const char *source,
 
 	fspath = realpath(target, NULL);
 	from = realpath(source, NULL);
+	if (! from && errno == ENOENT)
+		/* "source" is not necessarily in filesystem namespace (cf. ZFS) */
+		from = xstrdup(source);
 
 	build_iovec(&iov, &iovlen, "fstype", (void*)filesystemtype, (size_t)-1);
 	build_iovec(&iov, &iovlen, "fspath", fspath, (size_t)-1);

Reply via email to