Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/console-tools/loadkmap.c

    r3232 r3621  
    1111//usage:       "< keymap"
    1212//usage:#define loadkmap_full_usage "\n\n"
    13 //usage:       "Load a binary keyboard translation table from stdin\n"
    14 /* //usage:     "\n -C TTY  Affect TTY instead of /dev/tty" */
     13//usage:       "Load a binary keyboard translation table from stdin"
     14////usage:       "\n"
     15////usage:       "\n    -C TTY  Affect TTY instead of /dev/tty"
    1516//usage:
    1617//usage:#define loadkmap_example_usage
     
    4950        bb_show_usage();
    5051/* bb_warn_ignoring_args(argv[1]); */
     52
    5153    fd = get_console_fd_or_die();
    5254/* or maybe:
     
    5658
    5759    xread(STDIN_FILENO, flags, 7);
    58     if (strncmp(flags, BINARY_KEYMAP_MAGIC, 7))
     60    if (!is_prefixed_with(flags, BINARY_KEYMAP_MAGIC))
    5961        bb_error_msg_and_die("not a valid binary keymap");
    6062
     
    6264
    6365    for (i = 0; i < MAX_NR_KEYMAPS; i++) {
    64         if (flags[i] == 1) {
    65             xread(STDIN_FILENO, ibuff, NR_KEYS * sizeof(uint16_t));
    66             for (j = 0; j < NR_KEYS; j++) {
    67                 ke.kb_index = j;
    68                 ke.kb_table = i;
    69                 ke.kb_value = ibuff[j];
    70                 ioctl(fd, KDSKBENT, &ke);
    71             }
     66        if (flags[i] != 1)
     67            continue;
     68        xread(STDIN_FILENO, ibuff, NR_KEYS * sizeof(uint16_t));
     69        for (j = 0; j < NR_KEYS; j++) {
     70            ke.kb_index = j;
     71            ke.kb_table = i;
     72            ke.kb_value = ibuff[j];
     73            /*
     74             * Note: table[idx:0] can contain special value
     75             * K_ALLOCATED (marks allocated tables in kernel).
     76             * dumpkmap saves the value as-is; but attempts
     77             * to load it here fail, since it isn't a valid
     78             * key value: it is K(KT_SPEC,126) == 2<<8 + 126,
     79             * whereas last valid KT_SPEC is
     80             * K_BARENUMLOCK == K(KT_SPEC,19).
     81             * So far we just ignore these errors:
     82             */
     83            ioctl(fd, KDSKBENT, &ke);
    7284        }
    7385    }
Note: See TracChangeset for help on using the changeset viewer.