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 <sys/ioctl.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#include <linux/tty.h>
|
||||||
#define LDISC_N_SLCAN 17 /* default slcan line discipline since Kernel 2.6.25 */
|
|
||||||
|
|
||||||
void print_usage(char *prg)
|
void print_usage(char *prg)
|
||||||
{
|
{
|
||||||
|
|
@ -77,7 +76,7 @@ void print_usage(char *prg)
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
int ldisc = LDISC_N_SLCAN;
|
int ldisc = N_SLCAN;
|
||||||
int detach = 0;
|
int detach = 0;
|
||||||
int waitkey = 0;
|
int waitkey = 0;
|
||||||
int send_open = 0;
|
int send_open = 0;
|
||||||
|
|
|
||||||
6
slcand.c
6
slcand.c
|
|
@ -37,9 +37,7 @@
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#include <linux/tty.h>
|
||||||
/* default slcan line discipline since Kernel 2.6.25 */
|
|
||||||
#define LDISC_N_SLCAN 17
|
|
||||||
|
|
||||||
/* Change this to whatever your daemon is called */
|
/* Change this to whatever your daemon is called */
|
||||||
#define DAEMON_NAME "slcand"
|
#define DAEMON_NAME "slcand"
|
||||||
|
|
@ -180,7 +178,7 @@ int main(int argc, char *argv[])
|
||||||
char *btr = NULL;
|
char *btr = NULL;
|
||||||
int run_as_daemon = 1;
|
int run_as_daemon = 1;
|
||||||
char *pch;
|
char *pch;
|
||||||
int ldisc = LDISC_N_SLCAN;
|
int ldisc = N_SLCAN;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
ttypath[0] = '\0';
|
ttypath[0] = '\0';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue