branch Attitude Adjustment packages
[12.09/packages.git] / utils / setserial / patches / 100-compile-fixes.patch
1 Index: setserial-2.17/setserial.c
2 ===================================================================
3 --- setserial-2.17.orig/setserial.c     2010-10-24 11:21:21.000000000 +0200
4 +++ setserial-2.17/setserial.c  2010-10-24 11:26:55.000000000 +0200
5 @@ -15,14 +15,19 @@
6  #include <termios.h>
7  #include <string.h>
8  #include <errno.h>
9 +#include <stdlib.h>
10 +
11 +#include <linux/serial.h>
12  
13  #ifdef HAVE_ASM_IOCTLS_H
14  #include <asm/ioctls.h>
15  #endif
16  #ifdef HAVE_LINUX_HAYESESP_H
17  #include <linux/hayesesp.h>
18 +#ifdef TIOCGHAYESESP
19 +#define HAVE_HAYESESP
20 +#endif
21  #endif
22 -#include <linux/serial.h>
23  
24  #include "version.h"
25  
26 @@ -118,7 +123,7 @@
27         CMD_CONFIG,     "autoconfigure",0,              0,              0, 0,
28         CMD_GETMULTI,   "get_multiport",0,              0,              0, 0,
29         CMD_SETMULTI,   "set_multiport",0,              0,              0, 0,
30 -#ifdef TIOCGHAYESESP
31 +#ifdef HAVE_HAYESESP
32         CMD_RX_TRIG,    "rx_trigger",   0,              0,              0, FLAG_NEED_ARG,
33         CMD_TX_TRIG,    "tx_trigger",   0,              0,              0, FLAG_NEED_ARG,
34         CMD_FLOW_OFF,   "flow_off",     0,              0,              0, FLAG_NEED_ARG,
35 @@ -356,7 +361,7 @@
36  }
37  #endif
38  
39 -#ifdef TIOCGHAYESESP
40 +#ifdef HAVE_HAYESESP
41  void print_hayesesp(int fd)
42  {
43         struct hayes_esp_config esp;
44 @@ -453,7 +458,7 @@
45                 print_flags(&serinfo, "\tFlags: ", "");
46                 printf("\n\n");
47  
48 -#ifdef TIOCGHAYESESP
49 +#ifdef HAVE_HAYESESP
50                 print_hayesesp(fd);
51  #endif
52         } else if (verbosity==0) {
53 @@ -593,7 +598,7 @@
54                         }
55                         set_multiport(device, fd, &arg);
56                         break;
57 -#ifdef TIOCGHAYESESP
58 +#ifdef HAVE_HAYESESP
59                 case CMD_RX_TRIG:
60                 case CMD_TX_TRIG:
61                 case CMD_FLOW_OFF:
62 @@ -692,7 +697,7 @@
63         fprintf(stderr, "\t  get_multiport\tDisplay the multiport configuration\n");
64         fprintf(stderr, "\t  set_multiport\tSet the multiport configuration\n");
65         fprintf(stderr, "\n");
66 -#ifdef TIOCGHAYESESP
67 +#ifdef HAVE_HAYESESP
68         fprintf(stderr, "\t* rx_trigger\tSet RX trigger level (ESP-only)\n");
69         fprintf(stderr, "\t* tx_trigger\tSet TX trigger level (ESP-only)\n");
70         fprintf(stderr, "\t* flow_off\tSet hardware flow off level (ESP-only)\n");