summaryrefslogtreecommitdiffstats
path: root/source/l/hal/patches/set_X_keymap_properly.diff
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2009-08-26 10:00:38 -0500
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:41:17 +0200
commit5a12e7c134274dba706667107d10d231517d3e05 (patch)
tree55718d5acb710fde798d9f38d0bbaf594ed4b296 /source/l/hal/patches/set_X_keymap_properly.diff
downloadcurrent-5a12e7c134274dba706667107d10d231517d3e05.tar.gz
current-5a12e7c134274dba706667107d10d231517d3e05.tar.xz
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009 Slackware 13.0 x86_64 is released as stable! Thanks to everyone who helped make this release possible -- see the RELEASE_NOTES for the credits. The ISOs are off to the replicator. This time it will be a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We're taking pre-orders now at store.slackware.com. Please consider picking up a copy to help support the project. Once again, thanks to the entire Slackware community for all the help testing and fixing things and offering suggestions during this development cycle. As always, have fun and enjoy! -P.
Diffstat (limited to 'source/l/hal/patches/set_X_keymap_properly.diff')
-rw-r--r--source/l/hal/patches/set_X_keymap_properly.diff96
1 files changed, 96 insertions, 0 deletions
diff --git a/source/l/hal/patches/set_X_keymap_properly.diff b/source/l/hal/patches/set_X_keymap_properly.diff
new file mode 100644
index 000000000..933bcfa3f
--- /dev/null
+++ b/source/l/hal/patches/set_X_keymap_properly.diff
@@ -0,0 +1,96 @@
+diff --git a/tools/hal_set_property.c b/tools/hal_set_property.c
+index a99b059..3ab38bb 100644
+--- a/tools/hal_set_property.c
++++ b/tools/hal_set_property.c
+@@ -66,7 +66,7 @@ usage (int argc, char *argv[])
+ " (--int <value> | --string <value> | --bool <value> |\n"
+ " --strlist-pre <value> | --strlist-post <value> |\n"
+ " --strlist-rem <value> | --double <value> | --remove)\n"
+- " [--help] [--version]\n");
++ " [--direct] [--help] [--version]\n");
+ fprintf (stderr,
+ "\n" " --udi Unique Device Id\n"
+ " --key Key of the property to set\n"
+@@ -81,6 +81,7 @@ usage (int argc, char *argv[])
+ " --strlist-post Append a string to a list\n"
+ " --strlist-rem Remove a string from a list\n"
+ " --remove Indicates that the property should be removed\n"
++ " --direct Use direct HAL connection\n"
+ " --version Show version and exit\n"
+ " --help Show this information and exit\n"
+ "\n"
+@@ -114,6 +115,7 @@ main (int argc, char *argv[])
+ dbus_bool_t is_version = FALSE;
+ int type = PROP_INVALID;
+ DBusError error;
++ dbus_bool_t direct = FALSE;
+
+ if (argc <= 1) {
+ usage (argc, argv);
+@@ -135,6 +137,7 @@ main (int argc, char *argv[])
+ {"strlist-pre", 1, NULL, 0},
+ {"strlist-post", 1, NULL, 0},
+ {"strlist-rem", 1, NULL, 0},
++ {"direct", 0, NULL, 0},
+ {"remove", 0, NULL, 0},
+ {"version", 0, NULL, 0},
+ {"help", 0, NULL, 0},
+@@ -188,6 +191,8 @@ main (int argc, char *argv[])
+ type = PROP_STRLIST_REM;
+ } else if (strcmp (opt, "remove") == 0) {
+ remove = TRUE;
++ } else if (strcmp (opt, "direct") == 0) {
++ direct = TRUE;
+ } else if (strcmp (opt, "udi") == 0) {
+ udi = strdup (optarg);
+ } else if (strcmp (opt, "version") == 0) {
+@@ -215,24 +220,32 @@ main (int argc, char *argv[])
+
+ fprintf (stderr, "\n");
+
+- dbus_error_init (&error);
+- if ((hal_ctx = libhal_ctx_new ()) == NULL) {
+- fprintf (stderr, "error: libhal_ctx_new\n");
+- return 1;
+- }
+- if (!libhal_ctx_set_dbus_connection (hal_ctx, dbus_bus_get (DBUS_BUS_SYSTEM, &error))) {
+- fprintf (stderr, "error: libhal_ctx_set_dbus_connection: %s: %s\n", error.name, error.message);
+- LIBHAL_FREE_DBUS_ERROR (&error);
+- return 1;
+- }
+- if (!libhal_ctx_init (hal_ctx, &error)) {
+- if (dbus_error_is_set(&error)) {
+- fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
+- dbus_error_free (&error);
++ dbus_error_init (&error);
++ if (direct) {
++ if ((hal_ctx = libhal_ctx_init_direct (&error)) == NULL) {
++ fprintf (stderr, "error: libhal_ctx_init_direct\n");
++ LIBHAL_FREE_DBUS_ERROR (&error);
++ return 1;
++ }
++ } else {
++ if ((hal_ctx = libhal_ctx_new ()) == NULL) {
++ fprintf (stderr, "error: libhal_ctx_new\n");
++ return 1;
++ }
++ if (!libhal_ctx_set_dbus_connection (hal_ctx, dbus_bus_get (DBUS_BUS_SYSTEM, &error))) {
++ fprintf (stderr, "error: libhal_ctx_set_dbus_connection: %s: %s\n", error.name, error.message);
++ LIBHAL_FREE_DBUS_ERROR (&error);
++ return 1;
++ }
++ if (!libhal_ctx_init (hal_ctx, &error)) {
++ if (dbus_error_is_set(&error)) {
++ fprintf (stderr, "error: libhal_ctx_init: %s: %s\n", error.name, error.message);
++ dbus_error_free (&error);
++ }
++ fprintf (stderr, "Could not initialise connection to hald.\n"
++ "Normally this means the HAL daemon (hald) is not running or not ready.\n");
++ return 1;
+ }
+- fprintf (stderr, "Could not initialise connection to hald.\n"
+- "Normally this means the HAL daemon (hald) is not running or not ready.\n");
+- return 1;
+ }
+
+ if (remove) {