diff --git a/cmds-scrub.c b/cmds-scrub.c index 70d26832..8655d3d9 100644 --- a/cmds-scrub.c +++ b/cmds-scrub.c @@ -754,7 +754,7 @@ static int scrub_write_progress(pthread_mutex_t *m, const char *fsid, { int ret; int err; - int fd = 0; + int fd = -1; int old; ret = pthread_mutex_lock(m); @@ -782,7 +782,7 @@ static int scrub_write_progress(pthread_mutex_t *m, const char *fsid, goto out; out: - if (fd > 0) { + if (fd >= 0) { ret = close(fd); if (ret) err = -errno;