From: Martin Mares Date: Sat, 25 Aug 2007 11:56:18 +0000 (+0200) Subject: bopen_tmp_file(NULL) works. X-Git-Tag: holmes-import~506^2~13^2~84 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=deea16837b54b13974d1dfc24d9b1e6af2d14bb2;p=libucw.git bopen_tmp_file(NULL) works. --- diff --git a/lib/fb-param.c b/lib/fb-param.c index 0180f62b..26225f0e 100644 --- a/lib/fb-param.c +++ b/lib/fb-param.c @@ -86,6 +86,8 @@ bopen_fd_internal(int fd, struct fb_params *params, uns mode, const byte *name) static struct fastbuf * bopen_file_internal(const byte *name, int mode, struct fb_params *params, int try) { + if (!params) + params = &fbpar_def; if (params->type == FB_DIRECT && !fbdir_cheat) mode |= O_DIRECT; if (params->type == FB_MMAP && (mode & O_ACCMODE) == O_WRONLY) @@ -106,13 +108,13 @@ bopen_file_internal(const byte *name, int mode, struct fb_params *params, int tr struct fastbuf * bopen_file(const char *name, int mode, struct fb_params *params) { - return bopen_file_internal(name, mode, params ? : &fbpar_def, 0); + return bopen_file_internal(name, mode, params, 0); } struct fastbuf * bopen_file_try(const char *name, int mode, struct fb_params *params) { - return bopen_file_internal(name, mode, params ? : &fbpar_def, 1); + return bopen_file_internal(name, mode, params, 1); } struct fastbuf *