From: Martin Mares Date: Sat, 19 Jul 2008 21:38:00 +0000 (+0200) Subject: Libucw: added bopen_fd_name() X-Git-Tag: holmes-import~384 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=bcc82bcf6f70d8de01afdc4084df993d21bf2ddb;p=libucw.git Libucw: added bopen_fd_name() (picked from Michal's dev-vorner tree) --- diff --git a/ucw/fastbuf.h b/ucw/fastbuf.h index 920d83eb..89294f31 100644 --- a/ucw/fastbuf.h +++ b/ucw/fastbuf.h @@ -97,7 +97,11 @@ extern struct fb_params fbpar_def; struct fastbuf *bopen_file(const char *name, int mode, struct fb_params *params); /* Use params==NULL for defaults */ struct fastbuf *bopen_file_try(const char *name, int mode, struct fb_params *params); struct fastbuf *bopen_tmp_file(struct fb_params *params); -struct fastbuf *bopen_fd(int fd, struct fb_params *params); +struct fastbuf *bopen_fd_name(int fd, struct fb_params *params, const char *name); +static inline struct fastbuf *bopen_fd(int fd, struct fb_params *params) +{ + return bopen_fd_name(fd, params, NULL); +} /* FastIO on standard files (shortcuts for FB_STD) */ diff --git a/ucw/fb-param.c b/ucw/fb-param.c index bde4b58f..0ad576db 100644 --- a/ucw/fb-param.c +++ b/ucw/fb-param.c @@ -134,9 +134,9 @@ bopen_file_try(const char *name, int mode, struct fb_params *params) } struct fastbuf * -bopen_fd(int fd, struct fb_params *params) +bopen_fd_name(int fd, struct fb_params *params, const char *name) { - return bopen_fd_internal(fd, params ? : &fbpar_def, ~0U, NULL); + return bopen_fd_internal(fd, params ? : &fbpar_def, ~0U, name); } /* Function for use by individual file back-ends */