Imported Upstream version 2.0.90
[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
15 #include "libcommon.h"
16
17 int main(int argc, char *argv[])
18 {
19         int fd;
20         char *console = NULL;
21
22         set_progname(argv[0]);
23         setuplocale();
24
25         if (argc >= 3 && !strcmp(argv[1], "-C"))
26                 console = argv[2];
27
28         if ((fd = getfd(console)) < 0)
29                 kbd_error(EXIT_FAILURE, 0, _("Couldn't get a file descriptor referring to the console"));
30
31         return loadunimap(fd, NULL, NULL);
32 }