X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-merge-file.c;h=96edb97a8327ba64cccf64bfa341e94d9f903e94;hb=c841aa8b903200f5d7830c7c4ab8d62b5ef44c5c;hp=9d4e874809f495ad685a7218584041fa001696e5;hpb=df5e12f7d405b84de07c3f2dc1afe51b1d594e2c;p=git.git diff --git a/builtin-merge-file.c b/builtin-merge-file.c index 9d4e87480..96edb97a8 100644 --- a/builtin-merge-file.c +++ b/builtin-merge-file.c @@ -51,8 +51,11 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix) argc = parse_options(argc, argv, options, merge_file_usage, 0); if (argc != 3) usage_with_options(merge_file_usage, options); - if (quiet) - freopen("/dev/null", "w", stderr); + if (quiet) { + if (!freopen("/dev/null", "w", stderr)) + return error("failed to redirect stderr to /dev/null: " + "%s\n", strerror(errno)); + } for (i = 0; i < 3; i++) { if (!names[i])