summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
Diffstat (limited to 'zaptel.c')
-rwxr-xr-xzaptel.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/zaptel.c b/zaptel.c
index fcfedc1..714fc66 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -470,9 +470,6 @@ static int zaptel_proc_read(char *page, char **start, off_t off, int count, int
/* In Linux 2.6, this MUST NOT EXECEED 1024 bytes in one read! */
- if (off > 0)
- return 0;
-
span = (long)data;
if (!span)
@@ -552,15 +549,20 @@ static int zaptel_proc_read(char *page, char **start, off_t off, int count, int
if (chans[x]->nextslave && chans[x]->master->channo == x)
len += sprintf(page + len, "Master ");
}
+ }
+ if ((chans[x]->flags & ZT_FLAG_OPEN)) {
+ len += sprintf(page + len, "(In use) ");
+ }
+ len += sprintf(page + len, "\n");
}
- if ((chans[x]->flags & ZT_FLAG_OPEN)) {
- len += sprintf(page + len, "(In use) ");
- }
- len += sprintf(page + len, "\n");
-
+ if ( len <= off ) /* If everything printed so far is before beginning of request */
+ {
+ off -= len;
+ len = 0;
}
}
}
+ *start = page + off;
return len;
}
#endif
@@ -2428,7 +2430,7 @@ ioctl_load_zone(unsigned long data)
next[x] = td.next;
/* Make sure the "next" one is sane */
if ((next[x] >= th.count) || (next[x] < 0)) {
- printk("Invalid 'next' pointer\n");
+ printk("Invalid 'next' pointer: %d\n", next[x]);
kfree(slab);
return -EINVAL;
}