Skip to content
Snippets Groups Projects
Commit 5fbeebf8 authored by rswindell's avatar rswindell
Browse files

New useful function-like macro: CLOSE_OPEN_FILE(fd), conditionally closes

the file and sets the descriptor to -1 (if not already < 0).
parent 35ec0a00
No related branches found
No related tags found
No related merge requests found
......@@ -153,6 +153,8 @@
#define O_DENYNONE SH_DENYNO
#endif
#define CLOSE_OPEN_FILE(x) while((x) >= 0) { close(x); (x)=-1; break; }
/**************/
/* Prototypes */
/**************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment