summaryrefslogtreecommitdiff
path: root/usr/src/cmd/devfsadm/devfsadm.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/devfsadm/devfsadm.c')
-rw-r--r--usr/src/cmd/devfsadm/devfsadm.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/usr/src/cmd/devfsadm/devfsadm.c b/usr/src/cmd/devfsadm/devfsadm.c
index c7ccb7826c..a06fac3e02 100644
--- a/usr/src/cmd/devfsadm/devfsadm.c
+++ b/usr/src/cmd/devfsadm/devfsadm.c
@@ -3153,9 +3153,6 @@ rm_parent_dir_if_empty(char *pathname)
{
char *ptr, path[PATH_MAX + 1];
char *fcn = "rm_parent_dir_if_empty: ";
- finddevhdl_t fhandle;
- const char *f;
- int rv;
vprint(REMOVE_MID, "%schecking %s if empty\n", fcn, pathname);
@@ -3173,17 +3170,8 @@ rm_parent_dir_if_empty(char *pathname)
*ptr = '\0';
- if ((rv = finddev_readdir(path, &fhandle)) != 0) {
- err_print(OPENDIR_FAILED, path, strerror(rv));
- return;
- }
-
- /*
- * An empty pathlist implies an empty directory
- */
- f = finddev_next(fhandle);
- finddev_close(fhandle);
- if (f == NULL) {
+ if (finddev_emptydir(path)) {
+ /* directory is empty */
if (s_rmdir(path) == 0) {
vprint(REMOVE_MID,
"%sremoving empty dir %s\n", fcn, path);
@@ -8970,6 +8958,15 @@ bad_re:
}
/*
+ * Return 1 if we have reserved links.
+ */
+int
+devfsadm_have_reserved()
+{
+ return (enumerate_reserved ? 1 : 0);
+}
+
+/*
* This functions errs on the side of caution. If there is any error
* we assume that the devlink is *not* reserved
*/