Changeset 141319 in webkit
- Timestamp:
- Jan 30, 2013 2:44:52 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r141310 r141319 1 2013-01-30 Christophe Dumez <dchris@gmail.com> 2 3 [WK2][UNIX] g_spawn_sync() generates warning in PluginProcessProxy::scanPlugin() 4 https://bugs.webkit.org/show_bug.cgi?id=108371 5 6 Reviewed by Martin Robinson. 7 8 g_spawn_sync() was sometimes displaying a warning about the SIGCHLD 9 signal disposition not being set to SIG_DFL, despite the fix in r133755. 10 The reason was that the code was only setting the disposition to SIG_DFL 11 if the previous disposition was SIG_IGN. 12 13 In this patch, we set the SIGCHLD signal disposition to SIG_DFL, no 14 matter what its previous disposition was. Also, the signal disposition 15 is now restored to its previous state after the call to g_spawn_sync() 16 to avoid side effects. Finally, we now use SIGCHLD instead of SIDCLD 17 since this is the more compatible POSIX name. 18 19 * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: 20 (WebKit::spawnProcessSync): 21 (WebKit): 22 (WebKit::PluginProcessProxy::scanPlugin): 23 1 24 2013-01-30 Huang Dongsung <luxtella@company100.net> 2 25 -
trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
r141275 r141319 59 59 } 60 60 61 static bool spawnProcessSync(char** argv, char** standardOutput, char** standardError, int* exitStatus) 62 { 63 // If the disposition of SIGCHLD signal is set to SIG_IGN (default) then 64 // the signal will be ignored and g_spawn_sync() will not be able to return 65 // the status. As a consequence, we make sure that the disposition is set 66 // to SIG_DFL before calling g_spawn_sync(). 67 struct sigaction defaultAction, oldAction; 68 defaultAction.sa_handler = SIG_DFL; 69 defaultAction.sa_flags = 0; 70 sigemptyset(&defaultAction.sa_mask); 71 sigaction(SIGCHLD, &defaultAction, &oldAction); 72 73 bool success = g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, standardOutput, standardError, exitStatus, 0); 74 75 // Restore SIGCHLD signal disposition. 76 sigaction(SIGCHLD, &oldAction, 0); 77 78 return success; 79 } 80 61 81 bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result) 62 82 { … … 73 93 char* stdOut = 0; 74 94 75 // If the disposition of SIGCLD signal is set to SIG_IGN (default)76 // then the signal will be ignored and g_spawn_sync() will not be77 // able to return the status.78 // As a consequence, we make sure that the disposition is set to79 // SIG_DFL before calling g_spawn_sync().80 struct sigaction action;81 sigaction(SIGCLD, 0, &action);82 if (action.sa_handler == SIG_IGN) {83 action.sa_handler = SIG_DFL;84 sigaction(SIGCLD, &action, 0);85 }86 95 87 if (! g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, &stdOut, 0, &status, 0))96 if (!spawnProcessSync(argv, &stdOut, 0, &status)) 88 97 return false; 89 98
Note: See TracChangeset
for help on using the changeset viewer.