Lines 84-89
unmount_by_statfs(const struct statfs *sb, bool force)
Link Here
|
84 |
return (error); |
84 |
return (error); |
85 |
} |
85 |
} |
86 |
|
86 |
|
|
|
87 |
static int |
88 |
unmount_by_umount(struct statfs* sfp, bool force) |
89 |
{ |
90 |
FILE *f; |
91 |
|
92 |
if (sfp->f_fsid.val[0] == 0 || sfp->f_fsid.val[1] == 0) |
93 |
return (-1); |
94 |
|
95 |
if (force) |
96 |
f = auto_popen("umount", "-f", sfp->f_mntfromname, NULL); |
97 |
else |
98 |
f = auto_popen("umount", sfp->f_mntfromname, NULL); |
99 |
|
100 |
assert(f != NULL); |
101 |
return (auto_pclose(f)); |
102 |
} |
103 |
|
87 |
static const struct statfs * |
104 |
static const struct statfs * |
88 |
find_statfs(const struct statfs *mntbuf, int nitems, const char *mountpoint) |
105 |
find_statfs(const struct statfs *mntbuf, int nitems, const char *mountpoint) |
89 |
{ |
106 |
{ |
Lines 304-310
unmount_automounted(bool force)
Link Here
|
304 |
continue; |
321 |
continue; |
305 |
} |
322 |
} |
306 |
|
323 |
|
307 |
unmount_by_statfs(&(mntbuf[i]), force); |
324 |
if (unmount_by_umount(&(mntbuf[i]), force) != 0) |
|
|
325 |
unmount_by_statfs(&(mntbuf[i]), force); |
308 |
} |
326 |
} |
309 |
} |
327 |
} |
310 |
|
328 |
|