Commit cd7a5abc authored by Julius Athenstaedt's avatar Julius Athenstaedt Committed by Ramon Nou
Browse files

fix error code in rmdir handler

parent 50d97767
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -374,15 +374,6 @@ create_handler(fuse_req_t req, fuse_ino_t parent, const char* name, mode_t mode,
    fuse_reply_create(req, &e, fi);
}

// create a normal file with generated name?
// fake tmp file because it will be listed in the directory it is created in
static void
tmpfile_handler(fuse_req_t req, fuse_ino_t parent, mode_t mode,
                struct fuse_file_info* fi) {
    fuse_log(FUSE_LOG_DEBUG, "tmpfile handler \n");
    fuse_reply_err(req, ENOTSUP);
}

/// TODO normally, the file should only be removed if the lookup count is zero,
/// problem?
static void
@@ -701,7 +692,7 @@ rmdir_handler(fuse_req_t req, fuse_ino_t parent, const char* name) {
    std::string path = get_path(parent_inode, name);
    int rc = gkfs::syscall::gkfs_rmdir(path);
    if(rc == -1) {
        fuse_reply_err(req, 1);
        fuse_reply_err(req, errno);
        return;
    }
    fuse_reply_err(req, 0);
@@ -987,7 +978,7 @@ init_ll_ops(fuse_lowlevel_ops* ops) {
    // misc
    ops->init = init_handler;
    ops->destroy = destroy_handler;
    ops->tmpfile = tmpfile_handler;
    // ops->tmpfile // not supported in fuse < 3

    // ops->statfs = nullptr;
    // ops->flock