Check if the dictionary is empty and print a message if it's true.

This commit is contained in:
xtraeme 2007-08-26 10:20:33 +00:00
parent e44cd7ace2
commit 51e9d204ec

View File

@ -1,4 +1,4 @@
/* $NetBSD: envstat.c,v 1.41 2007/08/05 23:20:44 xtraeme Exp $ */
/* $NetBSD: envstat.c,v 1.42 2007/08/26 10:20:33 xtraeme Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@ -528,6 +528,11 @@ parse_dictionary(int fd)
if (rval)
return rval;
if (prop_dictionary_count(dict) == 0) {
warnx("no drivers registered");
goto out;
}
if (mydevname) {
obj = prop_dictionary_get(dict, mydevname);
if (prop_object_type(obj) != PROP_TYPE_ARRAY) {