Merge commit 'refs/top-bases/linux-configure-branch' into linux-configure-branch

This commit is contained in:
Brian Behlendorf 2009-01-14 14:27:46 -08:00
commit 922f424be6
1 changed files with 12 additions and 3 deletions

View File

@ -567,9 +567,17 @@ libzfs_init(void)
#endif
if ((hdl->libzfs_fd = open(ZFS_DEV, O_RDWR)) < 0) {
/* XXX: Allow this failure on linux systems for now. It
* occurs when we attempt to open the /dev/zfs without the
* ZFS module stack loaded. This is normally a problem but
* tools such as zdb call this function and never use the
* ioctl() interface. Long term this should be cleaned up.
*/
if (errno != ENXIO) {
free(hdl);
return (NULL);
}
}
#ifdef HAVE_SETMNTENT
if ((hdl->libzfs_mnttab = setmntent(MNTTAB, "r")) == NULL) {
@ -592,6 +600,7 @@ libzfs_init(void)
void
libzfs_fini(libzfs_handle_t *hdl)
{
if (hdl->libzfs_fd != -1)
(void) close(hdl->libzfs_fd);
if (hdl->libzfs_mnttab)
#ifdef HAVE_SETMNTENT