From: Baptiste Daroussin Date: Mon, 9 Jan 2023 08:31:38 +0000 (+0100) Subject: portability: avoid using fdclose() which does not exists on linux X-Git-Tag: RELEASE_1_4_0_a2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2a90922eed428e44360bb7fd10bca03ef7b1f3b;p=thirdparty%2Fmlmmj.git portability: avoid using fdclose() which does not exists on linux --- diff --git a/src/mlmmj-list.c b/src/mlmmj-list.c index bd38a1e2..13834c18 100644 --- a/src/mlmmj-list.c +++ b/src/mlmmj-list.c @@ -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) diff --git a/src/mlmmj-send.c b/src/mlmmj-send.c index a70c0457..d5458a5b 100644 --- a/src/mlmmj-send.c +++ b/src/mlmmj-send.c @@ -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,