Menu

#3 Check return codes everywhere

open-accepted
None
5
2007-02-12
2007-02-12
No

Some checks for return codes are missing.

Examples:
Would you like to add more error handling for return values from "pthread_mutex_lock" in functions like "write_buf_to_g15" and "lcdlist_init"?
http://g15daemon.svn.sourceforge.net/viewvc/g15daemon/trunk/g15daemon/g15daemon/linked_lists.c?revision=93&view=markup
http://g15daemon.svn.sourceforge.net/viewvc/g15daemon/trunk/g15daemon/g15daemon/utility_funcs.c?revision=93&view=markup

Discussion

  • Mike Lampard

    Mike Lampard - 2007-02-12

    Logged In: YES
    user_id=356931
    Originator: NO

    You're right, of course :)
    It always pays to check return values, but my understanding is that non-recursive non-errorchecking mutexes will not return until the lock has been granted to the calling thread, so the returnvalue is moot in this case. I should change the mutex type to the error-checking kind, and watch the return value. I'll add it to the top of my todo list. Of course, patches are always welcome too.

    Regards
    Mike

     
  • Mike Lampard

    Mike Lampard - 2007-02-12
    • assigned_to: nobody --> mlampard
    • status: open --> pending
     
  • Markus Elfring

    Markus Elfring - 2007-02-12

    Logged In: YES
    user_id=572001
    Originator: YES

    The return values of all Pthread functions should be checked. Otherwise, you will not notice that anything unexpected happened.
    Would you like to improve the robustness of your source code?

     
  • Markus Elfring

    Markus Elfring - 2007-02-12
    • status: pending --> open
     
  • Mike Lampard

    Mike Lampard - 2007-02-12
    • status: open --> open-accepted
     
  • Mike Lampard

    Mike Lampard - 2007-02-12

    Logged In: YES
    user_id=356931
    Originator: NO

    This, and a number of other fixes will be done in the near future, as time allows. Improving the general stability, along with usability features of the daemon is a high priority, believe it or not :)

    I appreciate your input, and thanks for the audit.
    Mike

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.