summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>2000-02-06 13:36:45 +0000
committerMartin Baulig <martin@src.gnome.org>2000-02-06 13:36:45 +0000
commit0daf65ef73ec2089aa16c12e2cd4e1c109f3a865 (patch)
treeeb1850d9285756c2b21a72e3d2095dc26e9ae9d9 /sysdeps
parent2eab7cfc483f2a754cc3ea71e8a6e40289850931 (diff)
downloadlibgtop-0daf65ef73ec2089aa16c12e2cd4e1c109f3a865.tar.gz
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.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/linux/ChangeLog4
-rw-r--r--sysdeps/linux/ppp.c29
2 files changed, 22 insertions, 11 deletions
diff --git a/sysdeps/linux/ChangeLog b/sysdeps/linux/ChangeLog
index fda368d0..840d5442 100644
--- a/sysdeps/linux/ChangeLog
+++ b/sysdeps/linux/ChangeLog
@@ -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>
* Makefile.am: Install the library in $(backenddir).
diff --git a/sysdeps/linux/ppp.c b/sysdeps/linux/ppp.c
index ec70ecdd..877e8c92 100644
--- a/sysdeps/linux/ppp.c
+++ b/sysdeps/linux/ppp.c
@@ -177,13 +177,11 @@ is_ISDN_on (glibtop *server, int device, int *online)
p = buffer+6;
- while (*p) {
+ for (i = 0; i <= device; i++) {
char *end = p;
- if (isspace (*p)) {
+ while (isspace (*p))
p++;
- continue;
- }
for (end = p; *end && !isspace (*end); end++)
;
@@ -191,23 +189,32 @@ is_ISDN_on (glibtop *server, int device, int *online)
if (*end == 0)
break;
else
- *end = 0;
+ *end++ = 0;
- if (!strcmp (p, "?") || !strcmp (p, "0")) {
- p = end+1;
+ if (i < device) {
+ p = end;
continue;
}
fclose (f);
- *online = TRUE;
- return TRUE;
+ if (strlen (p) != 1)
+ return FALSE;
+
+ if (*p == '0') {
+ *online = FALSE;
+ return TRUE;
+ } else if (*p == '1') {
+ *online = TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
}
fclose (f);
- *online = FALSE;
- return TRUE;
+ return FALSE;
}
static int