|
From: Braden M. <br...@us...> - 2006-01-28 18:58:37
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19996/mozilla-plugin/src/openvrml-player Modified Files: player.cpp Log Message: Launch the child openvrml-player process using g_spawn_async_with_pipes instead of fork/exec. Use the child process' stdin and stdout for the command and request channels, respectively, instead of specifying file descriptors for these on the command line. Index: player.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/player.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** player.cpp 23 Jan 2006 04:45:08 -0000 1.19 --- player.cpp 28 Jan 2006 18:58:25 -0000 1.20 *************** *** 146,150 **** GdkNativeWindow socket_id; - gint read_fd, write_fd; GOptionEntry options[] = { --- 146,149 ---- *************** *** 158,179 **** "GTK_SOCKET_ID" }, - { - "read-fd", - 0, - 0, - G_OPTION_ARG_INT, - &read_fd, - "file descriptor for reading commands", - "READ_FD" - }, - { - "write-fd", - 0, - 0, - G_OPTION_ARG_INT, - &write_fd, - "file descriptor for writing commands", - "WRITE_FD" - }, { 0, 0, 0, G_OPTION_ARG_NONE, 0, 0, 0 } }; --- 157,160 ---- *************** *** 236,241 **** struct command_channel_loop { ! command_channel_loop(const gint read_fd, command_istream & command_in): ! read_fd_(read_fd), command_in_(&command_in) {} --- 217,221 ---- struct command_channel_loop { ! explicit command_channel_loop(command_istream & command_in): command_in_(&command_in) {} *************** *** 246,250 **** data.main_context = g_main_context_new(); data.main_loop = g_main_loop_new(data.main_context, false); ! data.command_channel = g_io_channel_unix_new(this->read_fd_); GError * error = 0; GIOStatus status = --- 226,230 ---- data.main_context = g_main_context_new(); data.main_loop = g_main_loop_new(data.main_context, false); ! data.command_channel = g_io_channel_unix_new(0); // stdin GError * error = 0; GIOStatus status = *************** *** 292,296 **** private: - gint read_fd_; command_istream * command_in_; }; --- 272,275 ---- *************** *** 332,338 **** command_istream command_in; ! if (write_fd) { ! ::request_channel = g_io_channel_unix_new(write_fd); ! } GtkWidget * window = socket_id --- 311,315 ---- command_istream command_in; ! ::request_channel = g_io_channel_unix_new(1); // stdout GtkWidget * window = socket_id *************** *** 355,359 **** } else { function0<void> command_channel_loop_func = ! command_channel_loop(read_fd, command_in); command_channel_loop_thread.reset( threads.create_thread(command_channel_loop_func)); --- 332,336 ---- } else { function0<void> command_channel_loop_func = ! command_channel_loop(command_in); command_channel_loop_thread.reset( threads.create_thread(command_channel_loop_func)); |