From 1060dfbd2e17666b81f8dce71d1e4b2b8c8aacb9 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Tue, 2 Mar 2010 15:07:03 +0000 Subject: [PATCH] e: check whether fork failed SVN revision: 46787 --- src/bin/e_desklock.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c index d996d00..9421c63 100644 --- a/src/bin/e_desklock.c +++ b/src/bin/e_desklock.c @@ -711,14 +711,15 @@ static int _desklock_auth(char *passwd) { _e_desklock_state_set(E_DESKLOCK_STATE_CHECKING); - if ((_e_desklock_child_pid = fork())) + _e_desklock_child_pid = fork(); + if (_e_desklock_child_pid > 0) { /* parent */ _e_desklock_exit_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _e_desklock_cb_exit, NULL); } - else + else if (_e_desklock_child_pid == 0) { /* child */ int pamerr; @@ -762,6 +763,11 @@ _desklock_auth(char *passwd) free(current_user); exit(-1); } + else + { + _e_desklock_state_set(E_DESKLOCK_STATE_INVALID); + return 0; + } return 1; } -- 2.7.4