From: Eric Sandeen Date: Fri, 25 Jan 2013 00:18:49 +0000 (-0600) Subject: btrfs-progs: don't double-close prg_fd X-Git-Tag: upstream/4.16.1~3459^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6bd3a02fa67369c8a53c1b457e72c7330cfef3af;p=platform%2Fupstream%2Fbtrfs-progs.git 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 Signed-off-by: Zach Brown --- 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; } /*