9ns: Support SYS_rmdir
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 1 Mar 2018 20:46:35 +0000 (15:46 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 30 Apr 2018 18:31:44 +0000 (14:31 -0400)
Just another remove.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/syscall.c

index a6cf4b6..6805631 100644 (file)
@@ -2200,8 +2200,11 @@ intreg_t sys_rmdir(struct proc *p, const char *path, size_t path_l)
        char *t_path = copy_in_path(p, path, path_l);
        if (!t_path)
                return -1;
-       /* TODO: 9ns support */
        retval = do_rmdir(t_path);
+       if (retval < 0) {
+               unset_errno();
+               retval = sysremove(t_path);
+       }
        free_path(p, t_path);
        return retval;
 }