[PATCH] kdesu on freebsd

Frerich Raabe raabe at kde.org
Wed Sep 24 19:41:24 BST 2003


Am Wednesday 24 September 2003 19:53 schrieb Adriaan de Groot:
> The attached patch (against kdelibs/kdesu in HEAD) tries to fix kdesu on
> FreeBSD and do a little cleanup at the same time.

Excellent!

> The solution (bits): split out some of the wait and check process code into
> separate functions. I've added them to process.h, for want of a better
> place. Since that's a public header file, this may not be a good idea, but
> doing it differently would require adding a file.
>
> kdesu should check that su: is still running when it expects it to.

In ConverseSU I saw "state == 2 ? notauthorized : error" -- I think comparing 
"state" with an integer is not safe (I'm not sure but I think enums are not 
guaranteed to start at zero - in any case, using an enum value is more 
readable), better compare with "HandleStub" instead (which is what you meant, 
I guess).

> In su.{h,cpp}, I've replaced some integer constants by enums, in order to
> create some clarity in the forest of 0,1,2,-2,-1, etc. constants being
> thrown around.

If you now replace "checkMode" with "CheckMode", and "ConverseSU" with 
"converseSU", then it even fits to the KDE-wide naming scheme.

- Frerich

-- 
"If you fail to adjust your notion of fairness to the reality of the Universe, 
you will probably not be happy." - Paratima, of http://free-dc.org fame




More information about the kde-core-devel mailing list