Re: ftpd(8): remove double fflush(3) calls
Jan Klemkow writes: > ping? > > On Thu, May 13, 2021 at 04:44:23PM +0200, Jan Klemkow wrote: >> ping? >> >> On Wed, May 05, 2021 at 04:42:49PM +0200, Jan Klemkow wrote: >> > Hi, >> > >> > The function lreply() already calls fflush(3) on stdout. So, this calls >> > are useless. >> > >> > OK? OK gnezdo >> > >> > bye, >> > Jan >> > >> > Index: ftpd.c >> > === >> > RCS file: /cvs/src/libexec/ftpd/ftpd.c,v >> > retrieving revision 1.229 >> > diff -u -p -r1.229 ftpd.c >> > --- ftpd.c 15 Jan 2020 22:06:59 - 1.229 >> > +++ ftpd.c 5 May 2021 14:39:25 - >> > @@ -568,7 +568,6 @@ main(int argc, char *argv[]) >> >line[strcspn(line, "\n")] = '\0'; >> >lreply(530, "%s", line); >> >} >> > - (void) fflush(stdout); >> >(void) fclose(fp); >> >reply(530, "System not available."); >> >exit(0); >> > @@ -578,7 +577,6 @@ main(int argc, char *argv[]) >> >line[strcspn(line, "\n")] = '\0'; >> >lreply(220, "%s", line); >> >} >> > - (void) fflush(stdout); >> >(void) fclose(fp); >> >/* reply(220,) must follow */ >> >} >> > @@ -1078,7 +1076,6 @@ pass(char *passwd) >> >line[strcspn(line, "\n")] = '\0'; >> >lreply(230, "%s", line); >> >} >> > - (void) fflush(stdout); >> >(void) fclose(fp); >> >} >> >free(motd); >> > @@ -2029,7 +2026,6 @@ cwd(char *path) >> >line[strcspn(line, "\n")] = '\0'; >> >lreply(250, "%s", line); >> >} >> > - (void) fflush(stdout); >> >(void) fclose(message); >> >} >> >ack("CWD"); >> > >>
Re: ftpd(8): remove double fflush(3) calls
ping? On Thu, May 13, 2021 at 04:44:23PM +0200, Jan Klemkow wrote: > ping? > > On Wed, May 05, 2021 at 04:42:49PM +0200, Jan Klemkow wrote: > > Hi, > > > > The function lreply() already calls fflush(3) on stdout. So, this calls > > are useless. > > > > OK? > > > > bye, > > Jan > > > > Index: ftpd.c > > === > > RCS file: /cvs/src/libexec/ftpd/ftpd.c,v > > retrieving revision 1.229 > > diff -u -p -r1.229 ftpd.c > > --- ftpd.c 15 Jan 2020 22:06:59 - 1.229 > > +++ ftpd.c 5 May 2021 14:39:25 - > > @@ -568,7 +568,6 @@ main(int argc, char *argv[]) > > line[strcspn(line, "\n")] = '\0'; > > lreply(530, "%s", line); > > } > > - (void) fflush(stdout); > > (void) fclose(fp); > > reply(530, "System not available."); > > exit(0); > > @@ -578,7 +577,6 @@ main(int argc, char *argv[]) > > line[strcspn(line, "\n")] = '\0'; > > lreply(220, "%s", line); > > } > > - (void) fflush(stdout); > > (void) fclose(fp); > > /* reply(220,) must follow */ > > } > > @@ -1078,7 +1076,6 @@ pass(char *passwd) > > line[strcspn(line, "\n")] = '\0'; > > lreply(230, "%s", line); > > } > > - (void) fflush(stdout); > > (void) fclose(fp); > > } > > free(motd); > > @@ -2029,7 +2026,6 @@ cwd(char *path) > > line[strcspn(line, "\n")] = '\0'; > > lreply(250, "%s", line); > > } > > - (void) fflush(stdout); > > (void) fclose(message); > > } > > ack("CWD"); > > >
Re: ftpd(8): remove double fflush(3) calls
ping? On Wed, May 05, 2021 at 04:42:49PM +0200, Jan Klemkow wrote: > Hi, > > The function lreply() already calls fflush(3) on stdout. So, this calls > are useless. > > OK? > > bye, > Jan > > Index: ftpd.c > === > RCS file: /cvs/src/libexec/ftpd/ftpd.c,v > retrieving revision 1.229 > diff -u -p -r1.229 ftpd.c > --- ftpd.c15 Jan 2020 22:06:59 - 1.229 > +++ ftpd.c5 May 2021 14:39:25 - > @@ -568,7 +568,6 @@ main(int argc, char *argv[]) > line[strcspn(line, "\n")] = '\0'; > lreply(530, "%s", line); > } > - (void) fflush(stdout); > (void) fclose(fp); > reply(530, "System not available."); > exit(0); > @@ -578,7 +577,6 @@ main(int argc, char *argv[]) > line[strcspn(line, "\n")] = '\0'; > lreply(220, "%s", line); > } > - (void) fflush(stdout); > (void) fclose(fp); > /* reply(220,) must follow */ > } > @@ -1078,7 +1076,6 @@ pass(char *passwd) > line[strcspn(line, "\n")] = '\0'; > lreply(230, "%s", line); > } > - (void) fflush(stdout); > (void) fclose(fp); > } > free(motd); > @@ -2029,7 +2026,6 @@ cwd(char *path) > line[strcspn(line, "\n")] = '\0'; > lreply(250, "%s", line); > } > - (void) fflush(stdout); > (void) fclose(message); > } > ack("CWD"); >
ftpd(8): remove double fflush(3) calls
Hi, The function lreply() already calls fflush(3) on stdout. So, this calls are useless. OK? bye, Jan Index: ftpd.c === RCS file: /cvs/src/libexec/ftpd/ftpd.c,v retrieving revision 1.229 diff -u -p -r1.229 ftpd.c --- ftpd.c 15 Jan 2020 22:06:59 - 1.229 +++ ftpd.c 5 May 2021 14:39:25 - @@ -568,7 +568,6 @@ main(int argc, char *argv[]) line[strcspn(line, "\n")] = '\0'; lreply(530, "%s", line); } - (void) fflush(stdout); (void) fclose(fp); reply(530, "System not available."); exit(0); @@ -578,7 +577,6 @@ main(int argc, char *argv[]) line[strcspn(line, "\n")] = '\0'; lreply(220, "%s", line); } - (void) fflush(stdout); (void) fclose(fp); /* reply(220,) must follow */ } @@ -1078,7 +1076,6 @@ pass(char *passwd) line[strcspn(line, "\n")] = '\0'; lreply(230, "%s", line); } - (void) fflush(stdout); (void) fclose(fp); } free(motd); @@ -2029,7 +2026,6 @@ cwd(char *path) line[strcspn(line, "\n")] = '\0'; lreply(250, "%s", line); } - (void) fflush(stdout); (void) fclose(message); } ack("CWD");