Merge commit 'refs/top-bases/linux-debug-zerocopy' into linux-debug-zerocopy
This commit is contained in:
commit
2b32a0752f
|
@ -567,9 +567,17 @@ libzfs_init(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((hdl->libzfs_fd = open(ZFS_DEV, O_RDWR)) < 0) {
|
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);
|
free(hdl);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((hdl->libzfs_mnttab = fopen(MNTTAB, "r")) == NULL) {
|
if ((hdl->libzfs_mnttab = fopen(MNTTAB, "r")) == NULL) {
|
||||||
(void) close(hdl->libzfs_fd);
|
(void) close(hdl->libzfs_fd);
|
||||||
|
@ -588,6 +596,7 @@ libzfs_init(void)
|
||||||
void
|
void
|
||||||
libzfs_fini(libzfs_handle_t *hdl)
|
libzfs_fini(libzfs_handle_t *hdl)
|
||||||
{
|
{
|
||||||
|
if (hdl->libzfs_fd != -1)
|
||||||
(void) close(hdl->libzfs_fd);
|
(void) close(hdl->libzfs_fd);
|
||||||
if (hdl->libzfs_mnttab)
|
if (hdl->libzfs_mnttab)
|
||||||
(void) fclose(hdl->libzfs_mnttab);
|
(void) fclose(hdl->libzfs_mnttab);
|
||||||
|
|
Loading…
Reference in New Issue