summaryrefslogtreecommitdiffstats
path: root/diag.c
diff options
context:
space:
mode:
Diffstat (limited to 'diag.c')
-rw-r--r--diag.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/diag.c b/diag.c
index bdbf98e..f43ed2e 100644
--- a/diag.c
+++ b/diag.c
@@ -47,12 +47,14 @@ void bfs_verror(const struct cmdline *cmdline, const char *format, va_list args)
}
void bfs_vwarning(const struct cmdline *cmdline, const char *format, va_list args) {
- int error = errno;
+ if (cmdline->warn) {
+ int error = errno;
- bfs_warning_prefix(cmdline);
+ bfs_warning_prefix(cmdline);
- errno = error;
- cvfprintf(cmdline->cerr, format, args);
+ errno = error;
+ cvfprintf(cmdline->cerr, format, args);
+ }
}
void bfs_error_prefix(const struct cmdline *cmdline) {