summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/kget.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1999-05-05 11:34:03 +0000
committerjkh <jkh@FreeBSD.org>1999-05-05 11:34:03 +0000
commit2f046ead7857172f2e15013c7430ce094707232b (patch)
tree71e297facf3fd13d5d8de04b5b5937fc87d3020b /usr.sbin/sysinstall/kget.c
parentab91f06287e9a0c28b4319993377ac5b9e6208a3 (diff)
downloadFreeBSD-src-2f046ead7857172f2e15013c7430ce094707232b.zip
FreeBSD-src-2f046ead7857172f2e15013c7430ce094707232b.tar.gz
Another round of updates for -current and 3.2
Diffstat (limited to 'usr.sbin/sysinstall/kget.c')
-rw-r--r--usr.sbin/sysinstall/kget.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/sysinstall/kget.c b/usr.sbin/sysinstall/kget.c
index 2520480..284683a 100644
--- a/usr.sbin/sysinstall/kget.c
+++ b/usr.sbin/sysinstall/kget.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kget.c,v 1.4 1999/03/10 02:50:31 jkh Exp $
+ * $Id: kget.c,v 1.5 1999/05/05 10:14:06 jkh Exp $
*/
#include "sysinstall.h"
@@ -34,7 +34,7 @@
int
kget(char *out)
{
- int len, i, bytes_written;
+ int len, i, bytes_written = 0;
char *buf;
char *mib1 = "machdep.uc_devlist";
char *mib2 = "machdep.uc_pnplist";
@@ -53,7 +53,7 @@ kget(char *out)
}
if (len <= 0) {
msgDebug("kget: mib1 has length of %d\n", len);
- return -1;
+ goto pnp;
}
buf = (char *)alloca(len * sizeof(char));
i = sysctlbyname(mib1, buf, &len, NULL, NULL);
@@ -70,7 +70,7 @@ kget(char *out)
return -1;
}
- i = bytes_written = 0;
+ i = 0;
while (i < len) {
id = (struct isa_device *)(buf + i);
p = (buf + i + sizeof(struct isa_device));
@@ -105,6 +105,8 @@ kget(char *out)
}
i += sizeof(struct isa_device) + 8;
}
+
+pnp:
/* Now, print the changes to PnP override table */
i = sysctlbyname(mib2, NULL, &len, NULL, NULL);
if (i) {
@@ -154,6 +156,7 @@ kget(char *out)
bytes_written += fprintf(fout,"\n");
}
} while ((i += sizeof(struct pnp_cinfo)) < len);
+
bail:
if (bytes_written)
fprintf(fout, "q\n");
OpenPOWER on IntegriCloud