diff options
author | Robin Gareus <robin@gareus.org> | 2013-06-07 16:54:47 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-06-07 16:54:47 +0200 |
commit | 024e556cb2c3fb95721aaa83954aed373d2c7d0f (patch) | |
tree | ca1e1222e3b1ccf05fd604104741b2aa82e7a63b /libs/surfaces | |
parent | 1053529e4fddcd00891cbbc08cf4107e8335f873 (diff) |
close network sockets on fork
fixes problem with external apps (ie. video-server) inheriting them.
Diffstat (limited to 'libs/surfaces')
-rw-r--r-- | libs/surfaces/osc/osc.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 009587ce85..9e80554f0b 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -166,6 +166,9 @@ OSC::start () _port++; continue; } + + int fd = lo_server_get_socket_fd (_osc_server); + fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC); #ifdef ARDOUR_OSC_UNIX_SERVER @@ -174,7 +177,7 @@ OSC::start () // attempt to create unix socket server too snprintf(tmpstr, sizeof(tmpstr), "/tmp/sooperlooper_XXXXXX"); - int fd = mkstemp(tmpstr); + fd = mkstemp(tmpstr); if (fd >= 0 ) { unlink (tmpstr); @@ -185,6 +188,8 @@ 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); } #endif |