patch-src_setvtrgb_c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. --- kbd-2.0.1.orig/src/setvtrgb.c 2013-08-27 22:45:33.000000000 +0200
  2. +++ kbd-2.0.1/src/setvtrgb.c 2014-03-24 13:10:47.000000000 +0100
  3. @@ -5,7 +5,7 @@
  4. #include <sys/ioctl.h>
  5. #include <linux/kd.h>
  6. #include <errno.h>
  7. -#include <error.h>
  8. +#include <err.h>
  9. #include "kbd.h"
  10. #include "getfd.h"
  11. #include "nls.h"
  12. @@ -60,7 +60,7 @@ set_colormap(unsigned char *colormap)
  13. /* Apply the color map to the tty via ioctl */
  14. if (ioctl(fd, PIO_CMAP, colormap) == -1)
  15. - error(EXIT_FAILURE, errno, "ioctl");
  16. + err(EXIT_FAILURE, "ioctl");
  17. close(fd);
  18. }
  19. @@ -72,7 +72,7 @@ parse_file(FILE *fd, const char *filenam
  20. unsigned int rows, cols, val;
  21. if ((cmap = calloc(3 * 16, sizeof(unsigned char))) == NULL)
  22. - error(EXIT_FAILURE, errno, "calloc");
  23. + err(EXIT_FAILURE, "calloc");
  24. for (rows = 0; rows < 3; rows++) {
  25. cols = 0;
  26. @@ -80,26 +80,26 @@ parse_file(FILE *fd, const char *filenam
  27. while (cols < 16) {
  28. if ((c = fscanf(fd, "%u", &val)) != 1) {
  29. if (c == EOF)
  30. - error(EXIT_FAILURE, errno, "fscanf");
  31. + err(EXIT_FAILURE, "fscanf");
  32. - error(EXIT_FAILURE, 0, _("Error: %s: Invalid value in field %u in line %u."),
  33. + err(EXIT_FAILURE, _("Error: %s: Invalid value in field %u in line %u."),
  34. filename, rows + 1, cols + 1);
  35. }
  36. cmap[rows + cols * 3] = (unsigned char) val;
  37. if (cols < 15 && fgetc(fd) != ',')
  38. - error(EXIT_FAILURE, 0, _("Error: %s: Insufficient number of fields in line %u."),
  39. + err(EXIT_FAILURE, _("Error: %s: Insufficient number of fields in line %u."),
  40. filename, rows + 1);
  41. cols++;
  42. }
  43. if ((c = fgetc(fd)) == EOF)
  44. - error(EXIT_FAILURE, 0, _("Error: %s: Line %u has ended unexpectedly.\n"),
  45. + err(EXIT_FAILURE, _("Error: %s: Line %u has ended unexpectedly.\n"),
  46. filename, rows + 1);
  47. if (c != '\n')
  48. - error(EXIT_FAILURE, 0, _("Error: %s: Line %u is too long.\n"),
  49. + err(EXIT_FAILURE, _("Error: %s: Line %u is too long.\n"),
  50. filename, rows + 1);
  51. }
  52. }
  53. @@ -141,7 +141,7 @@ main(int argc, char **argv) {
  54. } else {
  55. if ((fd = fopen(file, "r")) == NULL)
  56. - error(EXIT_FAILURE, errno, "fopen");
  57. + err(EXIT_FAILURE, "fopen");
  58. parse_file(fd, file);
  59. fclose(fd);