X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fnoerr%2Fnoerr.h;h=191b3d3cfc49eb76405b9b79f4680c0e622b43fd;hp=559ba6132840543f4d9a2e4fa1dcb07cb9cdf6fb;hb=8d43fa7458b0102d440f242f1a3a1b45fbb41827;hpb=650c775ff00cccd03fc84e7789a03c51d9839004 diff --git a/ccan/noerr/noerr.h b/ccan/noerr/noerr.h index 559ba613..191b3d3c 100644 --- a/ccan/noerr/noerr.h +++ b/ccan/noerr/noerr.h @@ -1,5 +1,6 @@ #ifndef NOERR_H #define NOERR_H +#include /** * close_noerr - close without stomping errno. @@ -10,6 +11,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.