From ea0f8eac1dbf92467d6bf11d030f04e0b249bcae Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 24 Oct 2011 13:56:03 +0400 Subject: [PATCH] util: Add open_fmt_ro helper Signed-off-by: Cyrill Gorcunov --- include/util.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/util.h b/include/util.h index 772de64b0..2a58f8b18 100644 --- a/include/util.h +++ b/include/util.h @@ -158,6 +158,8 @@ DIR *opendir_proc(char *fmt, ...); FILE *fopen_proc(char *fmt, char *mode, ...); int open_fmt(char *fmt, int mode, ...); +#define open_fmt_ro(fmt, ...) open_fmt(fmt, O_RDONLY, __VA_ARGS__) + #define __xalloc(op, size, ...) \ ({ \ void *___p = op( __VA_ARGS__ ); \