(mta_smtp): Fixed race condition between printing
the port number, which will be used by the testsuite, and actually starting to listen on that port.
Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -763,11 +763,11 @@ mta_smtp (int argc, char **argv) | ... | @@ -763,11 +763,11 @@ mta_smtp (int argc, char **argv) |
763 | status = bind (fd, (struct sockaddr *) &address, sizeof (address)); | 763 | status = bind (fd, (struct sockaddr *) &address, sizeof (address)); |
764 | } | 764 | } |
765 | while (status < 0); | 765 | while (status < 0); |
766 | printf ("%d\n", port); | ||
767 | fclose (stdout); | ||
768 | } | 766 | } |
769 | 767 | ||
770 | listen (fd, 5); | 768 | listen (fd, 5); |
769 | printf ("%d\n", port); | ||
770 | fclose (stdout); | ||
771 | while (1) | 771 | while (1) |
772 | { | 772 | { |
773 | fd_set rfds; | 773 | fd_set rfds; | ... | ... |
-
Please register or sign in to post a comment