On 09/19/2017 02:06 AM, Xiao Ni wrote:
Signed-off-by: Xiao Ni <xni@xxxxxxxxxx> --- mdadm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mdadm.c b/mdadm.c index d80aab3..7cdcdba 100644 --- a/mdadm.c +++ b/mdadm.c @@ -1734,6 +1734,8 @@ int main(int argc, char *argv[]) autodetect(); break; } + if (mdfd > 0) + close(mdfd); exit(rv); }
While technically not necessary, since exit() will result in file descriptors for the process getting closed, I do prefer to have the code clean up properly after itself. I have gone ahead and applied this one.
Cheers, Jes -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html