From f289f714cb7fd2f09dc163ff51478f0df6484740 Mon Sep 17 00:00:00 2001 From: dd Date: Sat, 6 Nov 2004 09:56:27 +0000 Subject: If there aren't any devices to list, output nothing instead of an empty line. This is consistent with other utilities. While I'm here, remove artifacts of the previous list implementation. --- sbin/mdconfig/mdconfig.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'sbin') diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index ac0a88e..8aa34ac 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -25,8 +25,6 @@ #include #include #include -#include -#include int list(const int); void mdmaybeload(void); @@ -247,13 +245,6 @@ main(int argc, char **argv) return (0); } -struct dl { - int unit; - SLIST_ENTRY(dl) slist; -}; - -SLIST_HEAD(, dl) dlist = SLIST_HEAD_INITIALIZER(&dlist); - int list(const int fd) { @@ -267,7 +258,8 @@ list(const int fd) } if (mdio.md_pad[0] - unit > 0) printf(" ... %d more", mdio.md_pad[0] - unit); - printf("\n"); + if (unit > 0) + printf("\n"); return (0); } -- cgit v1.1