/*
 * zfs_uninit_libshare(zhandle)
 *
 * Uninitialize the libshare API if it hasn't already been
 * uninitialized. It is OK to call multiple times.
 */
void
zfs_uninit_libshare(libzfs_handle_t *zhandle)
{
	if (zhandle != NULL && zhandle->libzfs_sharehdl != NULL) {
		sa_fini(zhandle->libzfs_sharehdl);
		zhandle->libzfs_sharehdl = NULL;
	}
}
Example #2
0
File: libshare.c Project: AB17/zfs
__attribute__((constructor)) static void
libshare_init(void)
{
	libshare_nfs_init();
	libshare_smb_init();

	/*
	 * This bit causes /etc/dfs/sharetab to be updated before libzfs gets a
	 * chance to read that file; this is necessary because the sharetab file
	 * might be out of sync with the NFS kernel exports (e.g. due to reboots
	 * or users manually removing shares)
	 */
	sa_fini(sa_init(0));
}
Example #3
0
void
libshare_init(void)
#endif
{
	libshare_nfs_init();
	libshare_smb_init();

	/*
	 * This bit causes /etc/dfs/sharetab to be updated before libzfs gets a
	 * chance to read that file; this is necessary because the sharetab file
	 * might be out of sync with the NFS kernel exports (e.g. due to reboots
	 * or users manually removing shares)
	 */
#ifndef __APPLE__
	sa_fini(sa_init(0));
#endif
}