Skip to content

Commit

Permalink
IPC: fix SIGTERM signal handling
Browse files Browse the repository at this point in the history
  • Loading branch information
o-sdn-o committed May 15, 2021
1 parent c7d8089 commit 7dfa993
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/netxs/os/system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,13 @@ namespace netxs::os
case SIGWINCH:
resize_handler();
break;
case SIGTERM:
log("tty : SIGTERM");
sock->shut();
log("tty : sock->xipc::shut called");
::signal (signal, SIG_DFL);
::raise (signal);
break;
default:
break;
}
Expand Down Expand Up @@ -2232,6 +2239,9 @@ namespace netxs::os
}
ok(::signal(SIGPIPE, SIG_IGN )); // Disable sigpipe.
ok(::signal(SIGWINCH, sig_hndl)); // Set resize handler.
log("tty : Set termination handler.");
ok(::signal(SIGTERM, sig_hndl)); // Set termination handler.
log("tty : Raise resize event.");
ok(::raise (SIGWINCH)); // Get current terminal window size.

#endif
Expand Down
3 changes: 2 additions & 1 deletion src/netxs/ui/controls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ namespace netxs::ui
{
//todo cache specific
sptr<face> coreface;
sptr<base> client; // mold: Client object.
face& canvas; // .: Form cache.

sptr<base> client; // mold: Client object.
public:
rgba title_fg_color = 0xFFffffff;
bool only_frame = faux;
Expand Down
1 change: 1 addition & 0 deletions src/netxs/ui/events.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ namespace netxs::events
{ }
~bell()
{
e2::sync lock;
signal<e2::release>(e2::dtor, id);
}
};
Expand Down

0 comments on commit 7dfa993

Please sign in to comment.