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
......@@ -153,6 +153,8 @@
#define O_DENYNONE SH_DENYNO
#endif
#define CLOSE_OPEN_FILE(x) while((x) >= 0) { close(x); (x)=-1; break; }
/**************/
/* Prototypes */
/**************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment