Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/modload Try first to use /dev/ksyms to get kernel symbo...
details: https://anonhg.NetBSD.org/src/rev/9e2e27748ecd
branches: trunk
changeset: 546289:9e2e27748ecd
user: ragge <ragge%NetBSD.org@localhost>
date: Thu Apr 24 20:18:31 2003 +0000
description:
Try first to use /dev/ksyms to get kernel symbols, if that fails mutter a
bit and fallback to the old way.
diffstat:
sbin/modload/modload.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diffs (38 lines):
diff -r 9a835a5d1674 -r 9e2e27748ecd sbin/modload/modload.c
--- a/sbin/modload/modload.c Thu Apr 24 20:13:05 2003 +0000
+++ b/sbin/modload/modload.c Thu Apr 24 20:18:31 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: modload.c,v 1.37 2003/04/11 07:49:31 jdolecek Exp $ */
+/* $NetBSD: modload.c,v 1.38 2003/04/24 20:18:31 ragge Exp $ */
/*
* Copyright (c) 1993 Terrence R. Lambert.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: modload.c,v 1.37 2003/04/11 07:49:31 jdolecek Exp $");
+__RCSID("$NetBSD: modload.c,v 1.38 2003/04/24 20:18:31 ragge Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -351,6 +351,19 @@
}
/*
+ * Check if /dev/ksyms can be used.
+ */
+ if (kname == NULL) {
+ int fd = open(_PATH_KSYMS, O_RDONLY);
+ if (fd < 0) {
+ warn("%s", _PATH_KSYMS);
+ } else {
+ close(fd);
+ kname = _PATH_KSYMS;
+ }
+ }
+
+ /*
* Determine name of kernel to use
*/
if (kname == NULL) {
Home |
Main Index |
Thread Index |
Old Index