diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-07 20:57:53 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-15 18:53:45 -0700 |
commit | 0bef21e8543dda7f02b5f4cb3008a7292d249842 (patch) | |
tree | 2ac14db6288588ed28d691053be1f1d5e6624965 /lib/mount_util.c | |
parent | 86b261490611ffb0ccd46d3f0f2ae9eca9ae98af (diff) |
Removed -o nonempty option
This brings the default behavior in-line with that of the
regular `mount` command.
Diffstat (limited to 'lib/mount_util.c')
-rw-r--r-- | lib/mount_util.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/mount_util.c b/lib/mount_util.c index a23ab0b..8b64ca2 100644 --- a/lib/mount_util.c +++ b/lib/mount_util.c @@ -333,39 +333,6 @@ char *fuse_mnt_resolve_path(const char *progname, const char *orig) return dst; } -int fuse_mnt_check_empty(const char *progname, const char *mnt, - mode_t rootmode, off_t rootsize) -{ - int isempty = 1; - - if (S_ISDIR(rootmode)) { - struct dirent *ent; - DIR *dp = opendir(mnt); - if (dp == NULL) { - fprintf(stderr, - "%s: failed to open mountpoint for reading: %s\n", - progname, strerror(errno)); - return -1; - } - while ((ent = readdir(dp)) != NULL) { - if (strcmp(ent->d_name, ".") != 0 && - strcmp(ent->d_name, "..") != 0) { - isempty = 0; - break; - } - } - closedir(dp); - } else if (rootsize) - isempty = 0; - - if (!isempty) { - fprintf(stderr, "%s: mountpoint is not empty\n", progname); - fprintf(stderr, "%s: if you are sure this is safe, use the 'nonempty' mount option\n", progname); - return -1; - } - return 0; -} - int fuse_mnt_check_fuseblk(void) { char buf[256]; |