mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
Merge pull request #123 from twasilczyk/slcand-android
Don't fail when it wasn't possible to fetch the interface name.
This commit is contained in:
@@ -370,8 +370,13 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* retrieve the name of the created CAN netdevice */
|
/* retrieve the name of the created CAN netdevice */
|
||||||
if (ioctl(fd, SIOCGIFNAME, ifr.ifr_name) < 0) {
|
if (ioctl(fd, SIOCGIFNAME, ifr.ifr_name) < 0) {
|
||||||
|
if (name) {
|
||||||
perror("ioctl SIOCGIFNAME");
|
perror("ioctl SIOCGIFNAME");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
} else {
|
||||||
|
/* Graceful degradation: we only needed the name for display. */
|
||||||
|
snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "<unknown>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
syslogger(LOG_NOTICE, "attached TTY %s to netdevice %s\n", ttypath, ifr.ifr_name);
|
syslogger(LOG_NOTICE, "attached TTY %s to netdevice %s\n", ttypath, ifr.ifr_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user