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>
This commit is contained in:
Yegor Yefremov
2014-01-23 13:46:19 +01:00
committed by Marc Kleine-Budde
parent 9c82d462f4
commit 49801ea8a6
+4 -3
View File
@@ -251,10 +251,11 @@ int main(int argc, char *argv[])
/* Prepare the tty device name string */
pch = strstr(tty, devprefix);
if (pch == tty)
print_usage(argv[0]);
if (pch != tty)
snprintf(ttypath, TTYPATH_LENGTH, "%s%s", devprefix, tty);
else
snprintf(ttypath, TTYPATH_LENGTH, "%s", tty);
syslog(LOG_INFO, "starting on TTY device %s", ttypath);
/* Daemonize */