Author: jsuchome Date: Mon Mar 3 16:55:15 2008 New Revision: 45167 URL: http://svn.opensuse.org/viewcvs/yast?rev=45167&view=rev Log: - added modalias to Supplements, so package could get selected automatically on the systems with UPEK fingerprint reader (#361636) - fixed handling of child process exit (#361638) - 2.16.3 Modified: trunk/fingerprint-reader/VERSION trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.h trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes trunk/fingerprint-reader/src/users_plugin_fingerprint_reader.ycp trunk/fingerprint-reader/yast2-fingerprint-reader.spec.in Modified: trunk/fingerprint-reader/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/VERSION?rev=45... ============================================================================== --- trunk/fingerprint-reader/VERSION (original) +++ trunk/fingerprint-reader/VERSION Mon Mar 3 16:55:15 2008 @@ -1 +1 @@ -2.16.2 +2.16.3 Modified: trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/agent-thinkfin... ============================================================================== --- trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc (original) +++ trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.cc Mon Mar 3 16:55:15 2008 @@ -38,6 +38,7 @@ ThinkFingerAgent::ThinkFingerAgent() : SCRAgent() { child_pid = -1; + child_retval = -1; } /** @@ -156,7 +157,7 @@ } else if (PC(0) == "state") { YCPMap retmap; - if (!child_pid) + if (child_pid == -1) { y2error ("ThinkFinger not initialized yet!"); return ret; @@ -178,19 +179,49 @@ } retmap->add (YCPString ("state"), YCPInteger (state)); } + else if (retval == 0) + { + // check if child is still alive + int status; + if (waitpid (-1, &status, WNOHANG) != 0) + { + if (WIFSIGNALED (status)) + { + y2error ("child process was killed"); + child_pid = -1; + return ret; + } + if (WIFEXITED (status)) + { + child_retval = WEXITSTATUS (status); + child_pid = -1; + return ret; + } + } + } return retmap; } // wait for child exit else if (PC(0) == "exit_status" ) { int status; int retval = 255; - wait (&status); - if (WIFSIGNALED (status)) - y2milestone ("child process was killed"); - else if (WIFEXITED (status)) + if (child_pid != -1) + { + wait (&status); + if (WIFSIGNALED (status)) + y2milestone ("child process was killed"); + else if (WIFEXITED (status)) + { + retval = WEXITSTATUS (status); + y2milestone ("retval is %d", retval); + } + } + else { - retval = WEXITSTATUS (status); - y2milestone ("retval is %d", retval); + y2milestone ("child process already dead"); + if (child_retval) + retval = child_retval; + child_retval = -1; } ret = YCPInteger (retval); close (data_pipe[0]); // close FD for reading @@ -237,6 +268,7 @@ { y2milestone ("... still alive, killing it", child_pid); kill (child_pid, 9); + wait (&status); } child_pid = -1; } Modified: trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/agent-thinkfin... ============================================================================== --- trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.h (original) +++ trunk/fingerprint-reader/agent-thinkfinger/src/ThinkFingerAgent.h Mon Mar 3 16:55:15 2008 @@ -102,7 +102,6 @@ */ virtual YCPValue otherCommand(const YCPTerm& term); - /** * array with pipe file descriptors */ @@ -113,6 +112,11 @@ */ pid_t child_pid; + /** + * return value of the child process + */ + int child_retval; + }; #endif /* _ThinkFingerAgent_h */ Modified: trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/package/yast2-... ============================================================================== --- trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes (original) +++ trunk/fingerprint-reader/package/yast2-fingerprint-reader.changes Mon Mar 3 16:55:15 2008 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Mon Mar 3 16:42:27 CET 2008 - jsuchome@suse.cz + +- added modalias to Supplements, so package could get selected + automatically on the systems with UPEK fingerprint reader (#361636) +- fixed handling of child process exit (#361638) +- 2.16.3 + +------------------------------------------------------------------- Mon Dec 10 16:21:43 CET 2007 - jsuchome@suse.cz - merged proofread texts Modified: trunk/fingerprint-reader/src/users_plugin_fingerprint_reader.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/src/users_plug... ============================================================================== --- trunk/fingerprint-reader/src/users_plugin_fingerprint_reader.ycp (original) +++ trunk/fingerprint-reader/src/users_plugin_fingerprint_reader.ycp Mon Mar 3 16:55:15 2008 @@ -170,7 +170,9 @@ if (ui == `cancel || ui == `back) { SCR::Execute (.thinkfinger.cancel); - y2milestone ("exit status after cancel: %1", SCR::Read (.thinkfinger.exit_status)); + // status label (canceled after user action) + UI::ReplaceWidget (`id (`rp), `Label (_("Canceled"))); + y2milestone ("canceled"); break; } sleep (100); Modified: trunk/fingerprint-reader/yast2-fingerprint-reader.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/fingerprint-reader/yast2-fingerpr... ============================================================================== --- trunk/fingerprint-reader/yast2-fingerprint-reader.spec.in (original) +++ trunk/fingerprint-reader/yast2-fingerprint-reader.spec.in Mon Mar 3 16:55:15 2008 @@ -5,6 +5,8 @@ BuildRequires: libthinkfinger libusb-devel BuildRequires: doxygen gcc-c++ yast2-core-devel perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite yast2-pam +Supplements: modalias(usb:v0483p2016d*dc*dsc*dp*ic*isc*ip*) + Conflicts: yast2-hardware-detection < 2.15.7 Summary: Configuration of fingerprint reader -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org