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>
This commit is contained in:
Jeremiah Mahler
2014-12-23 18:03:09 +01:00
committed by Oliver Hartkopp
parent d93ef0e372
commit ca79909197
2 changed files with 4 additions and 7 deletions
+2 -3
View File
@@ -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;
+2 -4
View File
@@ -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';