btrfs-progs: don't double-close prg_fd

If scrub start discovers that scrub is already running,
we need to set prg_fd to -1 before goto out, or we'll
try to close it again in the error path.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Zach Brown <zab@redhat.com>
master
Eric Sandeen 2013-01-24 18:18:49 -06:00 committed by Zach Brown
parent a70837ab1e
commit 6bd3a02fa6
1 changed files with 1 additions and 0 deletions

View File

@ -1192,6 +1192,7 @@ static int scrub_start(int argc, char **argv, int resume)
/* ... yes, so scrub must be running. error out */
fprintf(stderr, "ERROR: scrub already running\n");
close(prg_fd);
prg_fd = -1;
goto out;
}
/*