added EINTR support in daemon()
Showing
2 changed files
with
3 additions
and
0 deletions
... | @@ -3,6 +3,7 @@ Sean 'Shaleh' Perry <shaleh@debian.org> Wed, 6 Oct 1999 13:55:42 -0700 | ... | @@ -3,6 +3,7 @@ Sean 'Shaleh' Perry <shaleh@debian.org> Wed, 6 Oct 1999 13:55:42 -0700 |
3 | * Cleanup some compilation issues | 3 | * Cleanup some compilation issues |
4 | * changed "w+" to "w" in called to pop3_mainloop():ofile = fdopen() | 4 | * changed "w+" to "w" in called to pop3_mainloop():ofile = fdopen() |
5 | why was it called with w+? It is only ever used for writing. | 5 | why was it called with w+? It is only ever used for writing. |
6 | * catch EINTR in call to accept() (play nice w/ our UNIX friends) | ||
6 | 7 | ||
7 | Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 5 Oct 1999 23:06:33 -0700 | 8 | Sean 'Shaleh' Perry <shaleh@debian.org> Tue, 5 Oct 1999 23:06:33 -0700 |
8 | 9 | ... | ... |
... | @@ -330,6 +330,8 @@ pop3_daemon (unsigned int maxchildren) | ... | @@ -330,6 +330,8 @@ pop3_daemon (unsigned int maxchildren) |
330 | } | 330 | } |
331 | if ( (connfd = accept(listenfd, (SA *) &client, &size)) == -1) | 331 | if ( (connfd = accept(listenfd, (SA *) &client, &size)) == -1) |
332 | { | 332 | { |
333 | if (errno == EINTR) | ||
334 | continue; | ||
333 | syslog(LOG_ERR, "accept: %s", strerror(errno)); | 335 | syslog(LOG_ERR, "accept: %s", strerror(errno)); |
334 | exit(-1); | 336 | exit(-1); |
335 | } | 337 | } | ... | ... |
-
Please register or sign in to post a comment