aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libshare/nfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libshare/nfs.c')
-rw-r--r--lib/libshare/nfs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libshare/nfs.c b/lib/libshare/nfs.c
index 161bbfb0c..bbaea93fc 100644
--- a/lib/libshare/nfs.c
+++ b/lib/libshare/nfs.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <errno.h>
#include <libshare.h>
+#include <unistd.h>
#include "nfs.h"
@@ -281,6 +282,17 @@ fullerr:
return (error);
}
+void
+nfs_reset_shares(const char *lockfile, const char *exports)
+{
+ int nfs_lock_fd = -1;
+
+ if (nfs_exports_lock(lockfile, &nfs_lock_fd) == 0) {
+ (void) ! truncate(exports, 0);
+ nfs_exports_unlock(lockfile, &nfs_lock_fd);
+ }
+}
+
static boolean_t
nfs_is_shared_cb(void *userdata, char *line, boolean_t found_mountpoint)
{