Make this work with multiple ISDN devices.
2000-02-06 Martin Baulig <martin@home-of-linux.org> * ppp.c: Make this work with multiple ISDN devices.
This commit is contained in:
committed by
Martin Baulig
parent
2eab7cfc48
commit
0daf65ef73
@@ -1,3 +1,7 @@
|
|||||||
|
2000-02-06 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* ppp.c: Make this work with multiple ISDN devices.
|
||||||
|
|
||||||
2000-01-22 Martin Baulig <martin@home-of-linux.org>
|
2000-01-22 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* Makefile.am: Install the library in $(backenddir).
|
* Makefile.am: Install the library in $(backenddir).
|
||||||
|
@@ -177,13 +177,11 @@ is_ISDN_on (glibtop *server, int device, int *online)
|
|||||||
|
|
||||||
p = buffer+6;
|
p = buffer+6;
|
||||||
|
|
||||||
while (*p) {
|
for (i = 0; i <= device; i++) {
|
||||||
char *end = p;
|
char *end = p;
|
||||||
|
|
||||||
if (isspace (*p)) {
|
while (isspace (*p))
|
||||||
p++;
|
p++;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (end = p; *end && !isspace (*end); end++)
|
for (end = p; *end && !isspace (*end); end++)
|
||||||
;
|
;
|
||||||
@@ -191,23 +189,32 @@ is_ISDN_on (glibtop *server, int device, int *online)
|
|||||||
if (*end == 0)
|
if (*end == 0)
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
*end = 0;
|
*end++ = 0;
|
||||||
|
|
||||||
if (!strcmp (p, "?") || !strcmp (p, "0")) {
|
if (i < device) {
|
||||||
p = end+1;
|
p = end;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
||||||
*online = TRUE;
|
if (strlen (p) != 1)
|
||||||
return TRUE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (*p == '0') {
|
||||||
|
*online = FALSE;
|
||||||
|
return TRUE;
|
||||||
|
} else if (*p == '1') {
|
||||||
|
*online = TRUE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
||||||
*online = FALSE;
|
return FALSE;
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Reference in New Issue
Block a user