File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1289,7 +1289,9 @@ interpreter_t::exec_res_t interpreter_t::exec_command(const std::string& cmd)
12891289 if (load (f))
12901290 {
12911291 set_ignore_break_event (true );
1292- run (0 );
1292+ signal_mgr_t::instance ().disable_notifications ();
1293+ bool res = run (0 );
1294+ exit (res ? 0 : 1 );
12931295 return exec_res_t ::CMD_EXEC;
12941296 }
12951297
Original file line number Diff line number Diff line change @@ -98,7 +98,10 @@ bool signal_mgr_t::dispatch(signal_handler_t::event_t ev)
9898// dependences
9999bool _ev_dispatcher (signal_handler_t ::event_t ev)
100100{
101- return signal_mgr_t::instance ().dispatch (ev);
101+ if (! signal_mgr_t::instance ()._disable_notifications )
102+ return signal_mgr_t::instance ().dispatch (ev);
103+
104+ return true ;
102105}
103106
104107
Original file line number Diff line number Diff line change @@ -93,6 +93,18 @@ class signal_mgr_t
9393 i->second .erase (handle);
9494 }
9595
96+
97+ void disable_notifications () throw()
98+ {
99+ _disable_notifications = true ;
100+ }
101+
102+
103+ void enable_notifications () throw()
104+ {
105+ _disable_notifications = false ;
106+ }
107+
96108
97109protected:
98110 using hlist_t = std::set < signal_handler_t ::handle_t > ;
@@ -102,6 +114,8 @@ class signal_mgr_t
102114 bool dispatch (signal_handler_t ::event_t ev);
103115
104116 friend bool _ev_dispatcher (signal_handler_t ::event_t ev);
117+
118+ bool _disable_notifications = false ;
105119};
106120
107121
You can’t perform that action at this time.
0 commit comments