diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index f22a3c3654..5db7104334 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1008,7 +1008,7 @@ static int local_remove(FsContext *ctx, const char *path) int err = -1; dirfd = local_opendir_nofollow(ctx, dirpath); - if (dirfd) { + if (dirfd == -1) { goto out; }