summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-06-07 18:02:47 +0200
committerRobin Gareus <robin@gareus.org>2013-06-07 18:02:47 +0200
commitbdf91de8b7261ca9c23135a05a53f1a7961a9eff (patch)
tree1cb6dbc085b1c5d73bb951f3a2d94dcaa0943f67 /libs/surfaces
parent6b19f5a444fc17372fab6c3450f86ef657dbc956 (diff)
more OSC socket fcntl() close-on-exec
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/osc/osc.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index 4e80c4dad0..d02626f4af 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -191,9 +191,9 @@ OSC::start ()
if (_osc_unix_server) {
_osc_unix_socket_path = tmpstr;
+ fd = lo_server_get_socket_fd (_osc_unix_server)
+ fcntl(fdx, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
}
- fd = lo_server_get_socket_fd (_osc_unix_server)
- fcntl(fdx, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
}
#endif
@@ -232,19 +232,23 @@ OSC::thread_init ()
pthread_set_name (X_("OSC"));
if (_osc_unix_server) {
+ const int fd = lo_server_get_socket_fd (_osc_unix_server);
Glib::RefPtr<IOSource> src = IOSource::create (lo_server_get_socket_fd (_osc_unix_server), IO_IN|IO_HUP|IO_ERR);
src->connect (sigc::bind (sigc::mem_fun (*this, &OSC::osc_input_handler), _osc_unix_server));
src->attach (_main_loop->get_context());
local_server = src->gobj();
g_source_ref (local_server);
+ fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
}
if (_osc_server) {
- Glib::RefPtr<IOSource> src = IOSource::create (lo_server_get_socket_fd (_osc_server), IO_IN|IO_HUP|IO_ERR);
+ const int fd = lo_server_get_socket_fd (_osc_server);
+ Glib::RefPtr<IOSource> src = IOSource::create (fd, IO_IN|IO_HUP|IO_ERR);
src->connect (sigc::bind (sigc::mem_fun (*this, &OSC::osc_input_handler), _osc_server));
src->attach (_main_loop->get_context());
remote_server = src->gobj();
g_source_ref (remote_server);
+ fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
}
PBD::notify_gui_about_thread_creation (X_("gui"), pthread_self(), X_("OSC"), 2048);