Mercurial > hg > mlmmj
changeset 28:b7b8efd520ec
mlmmj-{,un}subscribe uses mygetline(int fd); now
author | mmj |
---|---|
date | Fri, 23 Apr 2004 07:25:12 +1000 |
parents | 91830455b49c |
children | f13d7b715cd6 |
files | src/mlmmj-unsubscribe.c src/subscriberfuncs.c |
diffstat | 2 files changed, 2 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mlmmj-unsubscribe.c Fri Apr 23 07:14:22 2004 +1000 +++ b/src/mlmmj-unsubscribe.c Fri Apr 23 07:25:12 2004 +1000 @@ -234,17 +234,11 @@ void unsubscribe(int subreadfd, int subwritefd, const char *address) { char *buf; - FILE *subfile; lseek(subreadfd, 0, SEEK_SET); lseek(subwritefd, 0, SEEK_SET); - if((subfile = fdopen(subreadfd, "r")) == NULL) { - log_error("could not fdopen subfilefd"); - exit(EXIT_FAILURE); - } - - while((buf = myfgetline(subfile))) { + while((buf = mygetline(subreadfd))) { if(strncasecmp(buf, address, strlen(address)) != 0) writen(subwritefd, buf, strlen(buf)); free(buf);
--- a/src/subscriberfuncs.c Fri Apr 23 07:14:22 2004 +1000 +++ b/src/subscriberfuncs.c Fri Apr 23 07:25:12 2004 +1000 @@ -19,14 +19,8 @@ int find_subscriber(int subfilefd, const char *address) { char *buf; - FILE *subfile; - if((subfile = fdopen(subfilefd, "r")) == NULL) { - log_error("could not fdopen subfilefd"); - exit(EXIT_FAILURE); - } - - while ((buf = myfgetline(subfile))) { + while ((buf = mygetline(subfilefd))) { while (buf[0] && isspace(buf[strlen(buf)-1])) buf[strlen(buf)-1] = '\0'; if (strcasecmp(buf, address) == 0) {