diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-07-31 21:18:45 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-07-31 21:18:45 +0000 |
commit | b2f523c3a778d041edb01452ede64b645eef7774 (patch) | |
tree | f1de9e004eb4d03487ac0c35fbdfb6ef054c1e7e | |
parent | 02baa6db8e92ae755f7b49a39dbdbe0a991e2601 (diff) |
Fix cat /proc/zaptel/foo bug (bug #4103)
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@713 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-x | zaptel.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 |