* of the GNU Lesser General Public License.
*/
-#include "ucw/lib.h"
-#include "ucw/conf.h"
-#include "ucw/io.h"
-#include "ucw/fastbuf.h"
+#include <ucw/lib.h>
+#include <ucw/conf.h>
+#include <ucw/io.h>
+#include <ucw/fastbuf.h>
+#include <ucw/trans.h>
#include <fcntl.h>
#include <stdio.h>
#ifdef CONFIG_DARWIN
return "Direct I/O is not supported on darwin";
#endif
-#ifndef CONFIG_DIRECT_IO
- return "Direct I/O disabled by configure switch -CONFIG_DIRECT_IO";
+#ifndef CONFIG_UCW_DIRECT_IO
+ return "Direct I/O disabled by configure switch -CONFIG_UCW_DIRECT_IO";
#endif
#ifndef CONFIG_UCW_FB_DIRECT
return "Direct I/O disabled by configure switch -CONFIG_UCW_FB_DIRECT";
return fb;
case FB_MMAP:
if (!~mode && (int)(mode = fcntl(fd, F_GETFL)) < 0)
- die("Cannot get flags of fd %d: %m", fd);
+ trans_throw("ucw.fb.open", NULL, "Cannot get flags of fd %d: %m", fd);
return bfmmopen_internal(fd, name, mode);
default:
ASSERT(0);
if (try)
return NULL;
else
- die("Unable to %s file %s: %m", (mode & O_CREAT) ? "create" : "open", name);
+ trans_throw("ucw.fb.open", NULL, "Unable to %s file %s: %m", (mode & O_CREAT) ? "create" : "open", name);
struct fastbuf *fb = bopen_fd_internal(fd, params, mode, name);
ASSERT(fb);
if (mode & O_APPEND)
msg(L_ERROR, "unlink(%s): %m", f->name);
case 0:
if (close(fd))
- die("close(%s): %m", f->name);
+ msg(L_ERROR, "close(%s): %m", f->name);
}
}