Menu

#3 Check return codes everywhere

closed-fixed
nobody
None
5
2010-10-09
2009-12-28
Anonymous
No

Some checks for return codes are missing.

Examples:
Would you like to add more error handling for return values from "fputs" like in the function "save_image" and from "pthread_join" in the function "Pt_Stop"?
http://portmedia.svn.sourceforge.net/viewvc/portmedia/scorealign/trunk/main.cpp?revision=112&view=markup
http://portmedia.svn.sourceforge.net/viewvc/portmedia/portmidi/trunk/porttime/ptlinux.c?revision=175&view=markup

Discussion

  • Markus Elfring

    Markus Elfring - 2009-12-28

    I suggest to avoid unchecked function calls.
    Would you like to detect every error situation as early as possible?

     
  • Roger B. Dannenberg

    pthread_join no longer has fputs
    save_image now checks return value from fopen. Since save_image is really for debugging, I don't think it's worth it to install better error handling -- if you run out of disk here, you have bigger problems (but I'll patch the code if you feel something better is really needed and you want to implement it).

     
  • Roger B. Dannenberg

    • status: open --> closed-fixed