X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fnoerr%2Fnoerr.h;h=99b0f69043ac458672597a7a3932a989528f491d;hb=8ccb14db10cfedc5c97c9222a7955cee8246b741;hp=559ba6132840543f4d9a2e4fa1dcb07cb9cdf6fb;hpb=650c775ff00cccd03fc84e7789a03c51d9839004;p=ccan diff --git a/ccan/noerr/noerr.h b/ccan/noerr/noerr.h index 559ba613..99b0f690 100644 --- a/ccan/noerr/noerr.h +++ b/ccan/noerr/noerr.h @@ -1,5 +1,7 @@ +/* CC0 (Public domain) - see LICENSE file for details */ #ifndef NOERR_H #define NOERR_H +#include /** * close_noerr - close without stomping errno. @@ -10,6 +12,15 @@ */ int close_noerr(int fd); +/** + * fclose_noerr - close without stomping errno. + * @fp: the FILE pointer. + * + * errno is saved and restored across the call to fclose: if an error occurs, + * the resulting (non-zero) errno is returned. + */ +int fclose_noerr(FILE *fp); + /** * unlink_noerr - unlink a file without stomping errno. * @pathname: the path to unlink.