use line discipline number from linux/tty.h
The line discipline number is provided in include/linux/tty.h. Use that instead of a #define in each program. Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>pull/1/head
parent
d93ef0e372
commit
ca79909197
|
|
@ -51,8 +51,7 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#include <termios.h>
|
||||
|
||||
#define LDISC_N_SLCAN 17 /* default slcan line discipline since Kernel 2.6.25 */
|
||||
#include <linux/tty.h>
|
||||
|
||||
void print_usage(char *prg)
|
||||
{
|
||||
|
|
@ -77,7 +76,7 @@ void print_usage(char *prg)
|
|||
int main(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
int ldisc = LDISC_N_SLCAN;
|
||||
int ldisc = N_SLCAN;
|
||||
int detach = 0;
|
||||
int waitkey = 0;
|
||||
int send_open = 0;
|
||||
|
|
|
|||
6
slcand.c
6
slcand.c
|
|
@ -37,9 +37,7 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#include <termios.h>
|
||||
|
||||
/* default slcan line discipline since Kernel 2.6.25 */
|
||||
#define LDISC_N_SLCAN 17
|
||||
#include <linux/tty.h>
|
||||
|
||||
/* Change this to whatever your daemon is called */
|
||||
#define DAEMON_NAME "slcand"
|
||||
|
|
@ -180,7 +178,7 @@ int main(int argc, char *argv[])
|
|||
char *btr = NULL;
|
||||
int run_as_daemon = 1;
|
||||
char *pch;
|
||||
int ldisc = LDISC_N_SLCAN;
|
||||
int ldisc = N_SLCAN;
|
||||
int fd;
|
||||
|
||||
ttypath[0] = '\0';
|
||||
|
|
|
|||
Loading…
Reference in New Issue