/[mldonkey]/mldonkey/src/daemon/driver/driverMain.ml
ViewVC logotype

Diff of /mldonkey/src/daemon/driver/driverMain.ml

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

revision 1.65 by spiralvoice, Sun Aug 21 14:26:00 2005 UTC revision 1.66 by spiralvoice, Sun Aug 21 16:05:20 2005 UTC
# Line 541  or getting a binary compiled with glibc Line 541  or getting a binary compiled with glibc
541        let oc = open_out "mlnet.pid" in        let oc = open_out "mlnet.pid" in
542        output_string oc ( Printf.sprintf "%s\n" ( string_of_int ( Unix.getpid () ) ) );        output_string oc ( Printf.sprintf "%s\n" ( string_of_int ( Unix.getpid () ) ) );
543        close_out oc;        close_out oc;
544        CommonGlobals.do_at_exit (fun _ -> Sys.remove "mlnet.pid" );        CommonGlobals.do_at_exit (fun _ -> try Sys.remove "mlnet.pid" with _ -> ());
545        if !verbose then lprintf_nl (_b "Starting with pid %s") (string_of_int(Unix.getpid ()))        if !verbose then lprintf_nl (_b "Starting with pid %s") (string_of_int(Unix.getpid ()))
546      );      );
547    
# Line 589  or getting a binary compiled with glibc Line 589  or getting a binary compiled with glibc
589    
590    if Autoconf.system <> "windows" then    if Autoconf.system <> "windows" then
591      MlUnix.set_signal  Sys.sigchld      MlUnix.set_signal  Sys.sigchld
592        (Sys.Signal_handle (fun _ -> lprintf_nl "SIGCHLD"));        (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGCHLD, doing nothing"));
593    
594    if Autoconf.system <> "windows" then    if Autoconf.system <> "windows" then
595      MlUnix.set_signal  Sys.sighup      MlUnix.set_signal  Sys.sighup
596        (Sys.Signal_handle (fun _ ->        (Sys.Signal_handle (fun _ ->
597           lprintf_nl "SIGHUP";           lprintf_nl "Received SIGHUP, closing all files/sockets";
598           BasicSocket.close_all ();           BasicSocket.close_all ();
599           Unix32.close_all ()           Unix32.close_all ()
600           ));           ));
601    
602    if Autoconf.system <> "windows" then    if Autoconf.system <> "windows" then
603      MlUnix.set_signal  Sys.sigpipe      MlUnix.set_signal  Sys.sigpipe
604        (Sys.Signal_handle (fun _ -> lprintf_nl "SIGPIPE"));        (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl "Received SIGPIPE, doing nothing"));
605    
606    MlUnix.set_signal  Sys.sigint    MlUnix.set_signal  Sys.sigint
607      (Sys.Signal_handle (fun _ -> lprintf_nl "SIGINT";      (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGINT, stopping MLDonkey...";
608          CommonGlobals.exit_properly 0));          CommonGlobals.exit_properly 0));
609    
610    MlUnix.set_signal  Sys.sigterm    MlUnix.set_signal  Sys.sigterm
611      (Sys.Signal_handle (fun _ -> lprintf_nl "SIGTERM";      (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGTERM, stopping MLDonkey...";
612          CommonGlobals.exit_properly 0));          CommonGlobals.exit_properly 0));
613    
614    if !verbose then lprintf_nl (_b "Activated system signal handling");    if !verbose then lprintf_nl (_b "Activated system signal handling");

Legend:
Removed from v.1.65  
changed lines
  Added in v.1.66

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