gisi: warn if GIsiModem is missing rather than fail

This commit is contained in:
Rémi Denis-Courmont 2009-08-19 17:04:27 +03:00 committed by Aki Niemi
parent b2ee53a99f
commit ffcbb25105
1 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,9 @@ GIOChannel *phonet_new(GIsiModem *modem, uint8_t resource)
fcntl(fd, F_SETFD, FD_CLOEXEC);
/* Use blocking mode on purpose. */
if (ifi == 0)
g_warning("Unspecified GIsiModem!");
else
if (if_indextoname(ifi, buf) == NULL ||
setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, buf, IF_NAMESIZE))
goto error;