chiark / gitweb /
detect-virt: detect User-Mode Linux
[elogind.git] / src / udev / keymap / keymap.c
index 0db56d26ad99a7dec01587dc1b8436f399d3f7be..ae0a19d3a3e2d913976c65852cc94bee5194d725 100644 (file)
@@ -7,19 +7,19 @@
  * Copyright (C) 2006, Lennart Poettering
  * Copyright (C) 2009, Canonical Ltd.
  *
- * keymap is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * keymap is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with keymap; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <stdio.h>
@@ -36,7 +36,7 @@
 #include <linux/limits.h>
 #include <linux/input.h>
 
-const struct key* lookup_key (const char *str, unsigned int len);
+static const struct key* lookup_key (const char *str, unsigned int len);
 
 #include "keys-from-name.h"
 #include "keys-to-name.h"
@@ -423,12 +423,13 @@ int main(int argc, char **argv)
                         /* Open override file if present, otherwise default file */
                         char keymap_path[PATH_MAX];
                         FILE *f;
-                        snprintf(keymap_path, sizeof(keymap_path), "%s%s", SYSCONFDIR "/udev/keymaps/", filearg);
+
+                        snprintf(keymap_path, sizeof(keymap_path), "/etc/udev/keymaps/%s", filearg);
                         f = fopen(keymap_path, "re");
                         if (f) {
                                 merge_table(fd, f);
                         } else {
-                                snprintf(keymap_path, sizeof(keymap_path), "%s%s", UDEVLIBEXECDIR "/keymaps/", filearg);
+                                snprintf(keymap_path, sizeof(keymap_path), UDEVLIBEXECDIR "/keymaps/%s", filearg);
                                 f = fopen(keymap_path, "re");
                                 if (f)
                                         merge_table(fd, f);