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>
#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)
{
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;
#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"
char *btr = NULL;
int run_as_daemon = 1;
char *pch;
- int ldisc = LDISC_N_SLCAN;
+ int ldisc = N_SLCAN;
int fd;
ttypath[0] = '\0';