summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6720e95)
raw | patch | inline | side by side (parent: 6720e95)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Fri, 26 Dec 2008 10:17:04 +0000 (11:17 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 27 Dec 2008 03:10:02 +0000 (19:10 -0800) |
Report the error if redirection of stderr to /dev/null failed.
This silences a compiler warning about ignoring the return value
of freopen() on Ubuntu 8.10.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This silences a compiler warning about ignoring the return value
of freopen() on Ubuntu 8.10.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-merge-file.c | patch | blob | history |
diff --git a/builtin-merge-file.c b/builtin-merge-file.c
index 9d4e874809f495ad685a7218584041fa001696e5..96edb97a8327ba64cccf64bfa341e94d9f903e94 100644 (file)
--- a/builtin-merge-file.c
+++ b/builtin-merge-file.c
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])