mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-27 10:24:22 +03:00
Add linux mntent support
Use mount entry if HAVE_SETMNTENT defined Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
d2c15e84e9
commit
2eadf037f5
@ -617,7 +617,11 @@ libzfs_init(void)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_SETMNTENT
|
||||||
|
if ((hdl->libzfs_mnttab = setmntent(MNTTAB, "r")) == NULL) {
|
||||||
|
#else
|
||||||
if ((hdl->libzfs_mnttab = fopen(MNTTAB, "r")) == NULL) {
|
if ((hdl->libzfs_mnttab = fopen(MNTTAB, "r")) == NULL) {
|
||||||
|
#endif
|
||||||
(void) close(hdl->libzfs_fd);
|
(void) close(hdl->libzfs_fd);
|
||||||
free(hdl);
|
free(hdl);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
@ -637,7 +641,11 @@ libzfs_fini(libzfs_handle_t *hdl)
|
|||||||
{
|
{
|
||||||
(void) close(hdl->libzfs_fd);
|
(void) close(hdl->libzfs_fd);
|
||||||
if (hdl->libzfs_mnttab)
|
if (hdl->libzfs_mnttab)
|
||||||
|
#ifdef HAVE_SETMNTENT
|
||||||
|
(void) endmntent(hdl->libzfs_mnttab);
|
||||||
|
#else
|
||||||
(void) fclose(hdl->libzfs_mnttab);
|
(void) fclose(hdl->libzfs_mnttab);
|
||||||
|
#endif
|
||||||
if (hdl->libzfs_sharetab)
|
if (hdl->libzfs_sharetab)
|
||||||
(void) fclose(hdl->libzfs_sharetab);
|
(void) fclose(hdl->libzfs_sharetab);
|
||||||
zfs_uninit_libshare(hdl);
|
zfs_uninit_libshare(hdl);
|
||||||
|
Loading…
Reference in New Issue
Block a user