Review Request: Fix hang in kcm_useraccount
Michael Palimaka
kensington at gentoo.org
Thu Aug 9 03:18:56 BST 2012
On 2012-08-09 02:59, Rolf Eike Beer wrote:
> Now we have the following situation in case the program has exited (if not the
> behavior is unchanged):
>
> -we read in one line, if it is empty we break. What happens if the first line
> of output is empty and correct output comes later?
That's why I originally went for readAll.
>
> -the line is not empty, we continue (new check)
>
> -we check if the line is empty (old check)
>
> So, what now?
>
> I would suggest the following:
>
> -readAll()
> -if empty, break
> -find a linebreak, if we have one: unreadLine for everything beyond it, cut
> the input line we have
> -move the readLine() and the isEmpty() of the old code together in the else
> (i.e. pidExited == NotExited).
>
> Eike
>
Isn't that what effectively what the original revision does (dropping
the unread since readLine after readAll is safe)?
If the program has exited:
- Read all output
- If no output is found, break
- If output is found, continue along the original code
The purpose of this change is only to break if the program has exited
without output.
All the best,
Michael
More information about the kde-core-devel
mailing list