summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2013-01-24 18:18:49 -0600
committerZach Brown <zab@redhat.com>2013-02-05 16:09:41 -0800
commit6bd3a02fa67369c8a53c1b457e72c7330cfef3af (patch)
tree0527427617c6622d6b6b24d06fc9a8aa9ef825f5
parenta70837ab1e33ceee70b5bc8c1d5969b897e57b72 (diff)
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>
-rw-r--r--cmds-scrub.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmds-scrub.c b/cmds-scrub.c
index 8655d3d9..31ace6d4 100644
--- a/cmds-scrub.c
+++ b/cmds-scrub.c
@@ -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;
}
/*