hal/hald/linux osspec.c,1.35,1.36
Joe Shaw
joe at freedesktop.org
Thu Aug 26 11:04:22 PDT 2004
Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv21069/hald/linux
Modified Files:
osspec.c
Log Message:
2004-08-26 Joe Shaw <joeshaw at novell.com>
* configure.in: Don't check for a C++ compiler... we don't have
any C++ code.
* doc/spec/hal-spec.xml.in: Add a section about kernel properties.
* hald/linux/osspec.c (osspec_probe): Get kernel info from uname()
and add the properties to the Computer device.
Index: osspec.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/osspec.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- osspec.c 25 Aug 2004 20:55:13 -0000 1.35
+++ osspec.c 26 Aug 2004 18:04:20 -0000 1.36
@@ -40,6 +40,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <sys/utsname.h>
#include <glib.h>
#include <dbus/dbus.h>
@@ -786,6 +787,7 @@
{
GSList *coldplug_list;
HalDevice *root;
+ struct utsname un;
/* build the coldplug list */
coldplug_list = compute_coldplug_list ();
@@ -803,6 +805,15 @@
hal_device_property_set_string (root, "info.product", "Computer");
hal_device_property_set_string (root, "info.udi", "/org/freedesktop/Hal/devices/computer");
hal_device_set_udi (root, "/org/freedesktop/Hal/devices/computer");
+
+ if (uname (&un) >= 0) {
+ hal_device_property_set_string (root, "kernel.name",
+ un.sysname);
+ hal_device_property_set_string (root, "kernel.version",
+ un.release);
+ hal_device_property_set_string (root, "kernel.machine",
+ un.machine);
+ }
/* begin processing the coldplug_list when computer is added */
g_signal_connect (root,
More information about the hal-commit
mailing list