/[monit]/monit/http/engine.c
ViewVC logotype

Diff of /monit/http/engine.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34 by martinp, Sun Sep 14 22:17:55 2003 UTC revision 1.35 by martinp, Wed Sep 17 18:00:52 2003 UTC
# Line 58  Line 58 
58  #include <unistd.h>  #include <unistd.h>
59  #endif  #endif
60    
61    #ifdef HAVE_FCNTL_H
62    #include <fcntl.h>
63    #endif
64    
65  #ifdef HAVE_STRING_H  #ifdef HAVE_STRING_H
66  #include <string.h>  #include <string.h>
67  #endif  #endif
# Line 468  static RequestWrapper socket_producer(in Line 472  static RequestWrapper socket_producer(in
472    
473    if( (rv= poll(fds, 1, 1000)) > 0) {    if( (rv= poll(fds, 1, 1000)) > 0) {
474    
475        pthread_mutex_lock(&Run.mutex_fd);
476    
477      if( (client= accept(server, (struct sockaddr*)&in, &len)) < 0) {      if( (client= accept(server, (struct sockaddr*)&in, &len)) < 0) {
478    
479          pthread_mutex_unlock(&Run.mutex_fd);
480    
481        if(stopped) {        if(stopped) {
482          log("http server: service stopped\n");          log("http server: service stopped\n");
483        } else if(errno == EINTR) {        } else if(errno == EINTR) {
# Line 482  static RequestWrapper socket_producer(in Line 490  static RequestWrapper socket_producer(in
490    
491      }      }
492    
493        if(fcntl(client, F_SETFD, fcntl(client, F_GETFD) | FD_CLOEXEC) == -1) {
494          close(client);
495          pthread_mutex_unlock(&Run.mutex_fd);
496          return NULL;
497        }
498    
499        pthread_mutex_unlock(&Run.mutex_fd);
500    
501    } else {    } else {
502    
503      if(rv < 0)      if(rv < 0)

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26