[almanah] VFS: Using g_open/g_close for plain/journal databases
- From: Álvaro Peña <alvaropg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [almanah] VFS: Using g_open/g_close for plain/journal databases
- Date: Wed, 31 Dec 2014 11:38:44 +0000 (UTC)
commit ca8ca12935c448e17dafe6da00bcfa29c3970d3f
Author: Álvaro Peña <alvaropg gmail com>
Date: Mon Dec 8 11:41:12 2014 +0100
VFS: Using g_open/g_close for plain/journal databases
src/vfs.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/vfs.c b/src/vfs.c
index c782147..91eb061 100644
--- a/src/vfs.c
+++ b/src/vfs.c
@@ -574,12 +574,16 @@ static int
almanah_vfs_close_simple_file (AlmanahSQLiteVFS *self)
{
int rc;
+ GError *error = NULL;
rc = demoFlushBuffer (self);
if (rc != SQLITE_OK)
return rc;
sqlite3_free (self->aBuffer);
- close (self->fd);
+ if (g_close (self->fd, &error) == FALSE) {
+ g_critical (_("Error closing file: %s"), error->message);
+ rc = SQLITE_IOERR;
+ }
return rc;
}
@@ -1002,7 +1006,7 @@ demoOpen (__attribute__ ((unused)) sqlite3_vfs *pVfs, /* VFS */
if (flags & SQLITE_OPEN_READONLY) oflags |= O_RDONLY;
if (flags & SQLITE_OPEN_READWRITE) oflags |= O_RDWR;
- self->fd = open (self->plain_filename, oflags, 0600);
+ self->fd = g_open (self->plain_filename, oflags, 0600);
if (self->fd < 0) {
sqlite3_free (aBuf);
if (self->plain_filename)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]