Imported Upstream version 2.0.4_rc1
[platform/upstream/kbd.git] / src / clrunimap.c
1 /*
2  * clrunimap.c
3  *
4  * Note: nowadays this kills kernel console output!
5  */
6 #include "config.h"
7
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <fcntl.h>
11 #include <string.h>
12 #include <linux/kd.h>
13 #include "kdmapop.h"
14 #include "getfd.h"
15 #include "nls.h"
16
17 int main(int argc, char *argv[])
18 {
19         int fd;
20         char *console = NULL;
21
22         setlocale(LC_ALL, "");
23         bindtextdomain(PACKAGE_NAME, LOCALEDIR);
24         textdomain(PACKAGE_NAME);
25
26         if (argc >= 3 && !strcmp(argv[1], "-C"))
27                 console = argv[2];
28
29         if ((fd = getfd(console)) < 0)
30                 kbd_error(EXIT_FAILURE, 0, _("Couldn't get a file descriptor referring to the console"));
31
32         return loadunimap(fd, NULL, NULL);
33 }