1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-31 16:57:10 +00:00

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.
This commit is contained in:
Dima Dorfman 2004-11-06 09:56:27 +00:00
parent 8bc61209d4
commit 9a777b93be
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137300

View File

@ -25,8 +25,6 @@
#include <sys/linker.h>
#include <sys/mdioctl.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/queue.h>
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);
}