/[monit]/monit/monit_http.c
ViewVC logotype

Diff of /monit/monit_http.c

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

revision 1.10 by hauk, Tue Dec 17 22:03:08 2002 UTC revision 1.11 by hauk, Fri Jan 10 10:42:26 2003 UTC
# Line 85  int check_httpd() { Line 85  int check_httpd() {
85   */   */
86  int can_http() {  int can_http() {
87    
88    if ( Run.dohttpd && Run.isdaemon ) {    if(Run.dohttpd && Run.isdaemon) {
89            
90      if(! has_hosts_allow() && ! Run.Auth.defined) {      if(! has_hosts_allow() && ! Run.Auth.defined) {
91                
# Line 113  void monit_http(int action) { Line 113  void monit_http(int action) {
113    
114    int status;    int status;
115    
116    switch ( action ) {    switch(action) {
117            
118    case STOP_HTTP: {    case STOP_HTTP: {
119            
# Line 130  void monit_http(int action) { Line 130  void monit_http(int action) {
130    
131    status= pthread_create(&thread, NULL, thread_wrapper, NULL);    status= pthread_create(&thread, NULL, thread_wrapper, NULL);
132        
133    if ( status != 0 ) {    if(status != 0) {
134            
135      log("%s: Failed to create the http server. Thread error -- %s.\n",      log("%s: Failed to create the http server. Thread error -- %s.\n",
136          prog, strerror(status));          prog, strerror(status));
# Line 149  static void *thread_wrapper(void *arg) { Line 149  static void *thread_wrapper(void *arg) {
149    
150    pthread_detach(pthread_self());    pthread_detach(pthread_self());
151        
152    /* Block the SIGUSR1 signal in this thread */    /* Block the SIGUSR1 and SIGHUP signals in this thread */
153    sigemptyset(&ns);    sigemptyset(&ns);
154    sigaddset(&ns, SIGUSR1);    sigaddset(&ns, SIGUSR1);
155      sigaddset(&ns, SIGHUP);
156    pthread_sigmask(SIG_BLOCK, &ns, NULL);    pthread_sigmask(SIG_BLOCK, &ns, NULL);
157    
158    start_httpd(Run.httpdport, 10, Run.bind_addr);    start_httpd(Run.httpdport, 10, Run.bind_addr);

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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