wget: check for final write errors for -O FILE too
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 15 Feb 2011 10:03:53 +0000 (11:03 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 15 Feb 2011 10:03:53 +0000 (11:03 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/wget.c

index 6c9a512117fb44ab2ae334654839ea9c5cd1817a..ad2bfa4b5a3f5f8e71a0e17c458989b4b45a0da5 100644 (file)
@@ -941,5 +941,8 @@ int wget_main(int argc UNUSED_PARAM, char **argv)
        while (*argv)
                exitcode |= download_one_url(*argv++);
 
+       if (G.output_fd >= 0)
+               xclose(G.output_fd);
+
        return exitcode;
 }