]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
portability: avoid using fdclose() which does not exists on linux
authorBaptiste Daroussin <bapt@FreeBSD.org>
Mon, 9 Jan 2023 08:31:38 +0000 (09:31 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Mon, 9 Jan 2023 08:31:38 +0000 (09:31 +0100)
src/mlmmj-list.c
src/mlmmj-send.c

index bd38a1e21418704093eed7f688651cea562c707a..13834c18cdbd3dbdd1d407f39c10d55c8062bc69 100644 (file)
@@ -67,7 +67,7 @@ dumpcount(int fd, size_t *count)
                        printf("%s\n", line);
        }
        free(line);
-       fdclose(f, NULL);
+       fclose(f);
 
        return 0;
 }
@@ -142,13 +142,11 @@ int main(int argc, char **argv)
 
                        fd = openat(subdirfd, dp->d_name, O_RDONLY|O_CLOEXEC);
                        dumpcount(fd, docount ? &count : NULL);
-                       close(fd);
                }
                closedir(dirp);
        } else {
                fd = openat(listfd, subfile, O_RDONLY|O_CLOEXEC);
                dumpcount(fd, docount ? &count : NULL);
-               close(fd);
        }
 
        if (docount)
index a70c0457c4deb363beb4aef098014a058c051b09..d5458a5bbe3bff3a95b6c8112022424ae4b15a58 100644 (file)
@@ -297,7 +297,7 @@ int send_mail_many_fd(int sockfd, struct mail *mail, int subfd,
                                return ret;
                }
        } while(res > 0);
-       fdclose(f, NULL);
+       fclose(f);
 
        if(tll_length(stl)) {
                ret = send_mail_many_list(sockfd, mail, &stl, listaddr, listdelim,