From 4bfefca266ab1fb3a805e9ed4f12ad5be3f316bb Mon Sep 17 00:00:00 2001 From: kn Date: Mon, 21 Aug 2023 08:13:37 +0000 Subject: [PATCH] Print softraid(4) errors on standard error INFO messages remain on stdin, WARN/ERROR go to stderr as usual to make silencing and scripting bioctl(8) easier. OK op jsing --- sbin/bioctl/bioctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c index 920f997606e..5a54734e33d 100644 --- a/sbin/bioctl/bioctl.c +++ b/sbin/bioctl/bioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bioctl.c,v 1.152 2023/08/18 14:09:19 kn Exp $ */ +/* $OpenBSD: bioctl.c,v 1.153 2023/08/21 08:13:37 kn Exp $ */ /* * Copyright (c) 2004, 2005 Marco Peereboom @@ -376,7 +376,8 @@ bio_status(struct bio_status *bs) prefix = __progname; for (i = 0; i < bs->bs_msg_count; i++) - printf("%s: %s\n", prefix, bs->bs_msgs[i].bm_msg); + fprintf(bs->bs_msgs[i].bm_type == BIO_MSG_INFO ? + stdout : stderr, "%s: %s\n", prefix, bs->bs_msgs[i].bm_msg); if (bs->bs_status == BIO_STATUS_ERROR) { if (bs->bs_msg_count == 0) -- 2.20.1