slcand: accept both tty* and /dev/tty* device names
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>pull/1/head
parent
9c82d462f4
commit
49801ea8a6
7
slcand.c
7
slcand.c
|
|
@ -251,10 +251,11 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* Prepare the tty device name string */
|
/* Prepare the tty device name string */
|
||||||
pch = strstr(tty, devprefix);
|
pch = strstr(tty, devprefix);
|
||||||
if (pch == tty)
|
if (pch != tty)
|
||||||
print_usage(argv[0]);
|
snprintf(ttypath, TTYPATH_LENGTH, "%s%s", devprefix, tty);
|
||||||
|
else
|
||||||
|
snprintf(ttypath, TTYPATH_LENGTH, "%s", tty);
|
||||||
|
|
||||||
snprintf(ttypath, TTYPATH_LENGTH, "%s%s", devprefix, tty);
|
|
||||||
syslog(LOG_INFO, "starting on TTY device %s", ttypath);
|
syslog(LOG_INFO, "starting on TTY device %s", ttypath);
|
||||||
|
|
||||||
/* Daemonize */
|
/* Daemonize */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue