]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
mlmmj-{,un}subscribe uses mygetline(int fd); now
authormmj <none@none>
Thu, 22 Apr 2004 21:25:12 +0000 (07:25 +1000)
committermmj <none@none>
Thu, 22 Apr 2004 21:25:12 +0000 (07:25 +1000)
src/mlmmj-unsubscribe.c
src/subscriberfuncs.c

index c1ce02384b47d66152a417039ac17c79748e5972..46753f4ef6af058c8b9724fde8e4bae5c420dfd0 100644 (file)
@@ -234,17 +234,11 @@ void generate_unsubconfirm(const char *listdir, const char *listaddr,
 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);
index 75c9262362ea16d6cad3af87f4afcd2dab20c258..9c436394ccc4273e30bef52266402cc837cdbfe1 100644 (file)
 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) {