LWN.net Logo

Humphrey: On Code Review

Humphrey: On Code Review

Posted Jan 21, 2013 15:47 UTC (Mon) by dps (subscriber, #5725)
Parent article: Humphrey: On Code Review

It can be very difficult to fix things.esp. if they come from third parties.

A large SAN vendor, who shall remain nameless, provided a command line tool where 0, 255 (-1) and 2 all mean various sorts of failure and 1 success. It should not require code review to limit the numbers passed to exit(3) to 0 to 255 and make success exit status 0.

However we support issues meant that instead of fixing this the code that uses this tools works around it: when calling this particular program non-standard exit code processing knows that 1 mean success,

In a similar vein if an existing program can do something at a push it might be preferred to a new one that does exactly what is required. Let it suffice to say that one large commercial product is affected.


(Log in to post comments)

Humphrey: On Code Review

Posted Jan 21, 2013 20:02 UTC (Mon) by JoeBuck (subscriber, #2330) [Link]

Perhaps I'm missing something, but isn't that the kind of thing code review is supposed to catch: reviewers reject the original code and require either that the new code be fixed to follow the standard error convention, or if the third-party code can't be changed, to always call it via a wrapper so the translation of error codes happens in one place?

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds