D13079: use a consistent style to handle fork()

Albert Astals Cid noreply at phabricator.kde.org
Wed May 23 22:00:27 UTC 2018


aacid added inline comments.

INLINE COMMENTS

> pam_kwallet.c:441
> +    switch (pid) {
> +    case 0:
> +        break;

This construct makes the code harder to read imho, previously it was clear that the parent (i.e. pid != 0) was being exited and the child (outside the if) left to live, now you have to realize that case 0 has a break and that there's code below that will be executed.

If you really feel that strong about having all the forks be switch, i'd like a comment here saying something like "child execution continues outside the switch", i know it's obvious but it took me a while to realize, and i've been reading this code a lot lately.

REPOSITORY
  R107 KWallet PAM Integration

REVISION DETAIL
  https://phabricator.kde.org/D13079

To: dakon, aacid
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180523/6ab198de/attachment.html>


More information about the Plasma-devel mailing list