Author: jsuchome Date: Fri Mar 7 15:33:41 2008 New Revision: 45293 URL: http://svn.opensuse.org/viewcvs/yast?rev=45293&view=rev Log: - wait for child exit with WNOHANG (bnc#361638) - 2.16.4 Modified: trunk/fingerprint-reader/VERSION trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes trunk/fingerprint-reader/src/users_plugin_fingerprint_reader.ycp Modified: trunk/fingerprint-reader/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/VERSION?rev=45293&r1=45292&r2=45293&view=diff ============================================================================== --- trunk/fingerprint-reader/VERSION (original) +++ trunk/fingerprint-reader/VERSION Fri Mar 7 15:33:41 2008 @@ -1 +1 @@ -2.16.3 +2.16.4 Modified: trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc?rev=45293&r1=45292&r2=45293&view=diff ============================================================================== --- trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc (original) +++ trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc Fri Mar 7 15:33:41 2008 @@ -201,7 +201,34 @@ } return retmap; } - // wait for child exit + // check if child process exited + else if (PC(0) == "check_exit" ) { + int status; + ret = YCPBoolean (false); + if (child_pid != -1) + { + if (waitpid (child_pid, &status, WNOHANG) != 0) + { + child_pid = -1; + ret = YCPBoolean (true); + if (WIFSIGNALED (status)) + { + y2error ("child process was killed"); + } + if (WIFEXITED (status)) + { + child_retval = WEXITSTATUS (status); + } + } + } + else + { + y2milestone ("child process already exited"); + ret = YCPBoolean (true); + } + } + // wait for child exit if it still not exited (do not use this part) + // return child exit value else if (PC(0) == "exit_status" ) { int status; int retval = 255; @@ -218,7 +245,7 @@ } else { - y2milestone ("child process already dead"); + y2milestone ("child process already exited"); if (child_retval) retval = child_retval; child_retval = -1; Modified: trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes?rev=45293&r1=45292&r2=45293&view=diff ============================================================================== --- trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes (original) +++ trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes Fri Mar 7 15:33:41 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Mar 7 15:16:53 CET 2008 - jsuchome@suse.cz + +- wait for child exit with WNOHANG (bnc#361638) +- 2.16.4 + +------------------------------------------------------------------- Mon Mar 3 16:42:27 CET 2008 - jsuchome@suse.cz - added modalias to Supplements, so package could get selected Modified: trunk/fingerprint-reader/src/users_plugin_fingerprint_reader.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/src/users_plugin_fingerprint_reader.ycp?rev=45293&r1=45292&r2=45293&view=diff ============================================================================== --- trunk/fingerprint-reader/src/users_plugin_fingerprint_reader.ycp (original) +++ trunk/fingerprint-reader/src/users_plugin_fingerprint_reader.ycp Fri Mar 7 15:33:41 2008 @@ -92,6 +92,30 @@ integer swipe_success = 0; integer swipe_failed = 0; + // helper function: return exit status of the thinkfinger proccess; + // regulary check user input for `cancel button + integer get_exit_status () { + integer ex = exit_status; + while (true) + { + boolean exited = (boolean) SCR::Read (.thinkfinger.check_exit); + if (exited) + { + ex = (integer) SCR::Read (.thinkfinger.exit_status); + break; + } + ui = UI::PollInput (); + if (ui == `cancel) + { + SCR::Execute (.thinkfinger.cancel); + UI::ReplaceWidget (`id (`rp), `Label (_("Canceled"))); + break; + } + sleep (100); + } + return ex; + } + // helper function, form the string for UI from actuall data void replace_swipe_string () { @@ -156,12 +180,12 @@ } else if (statemap == nil) { - exit_status = (integer) SCR::Read (.thinkfinger.exit_status); + exit_status = get_exit_status (); break; } if (exit) { - exit_status = (integer) SCR::Read (.thinkfinger.exit_status); + exit_status = get_exit_status (); break;//must be before check for cancel } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org