[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: ensure psql fails hard if there is an er
From: |
gnunet |
Subject: |
[gnunet] branch master updated: ensure psql fails hard if there is an error in the SQL (fixes #6437) |
Date: |
Wed, 22 Jul 2020 21:53:38 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 8703a0516 ensure psql fails hard if there is an error in the SQL
(fixes #6437)
8703a0516 is described below
commit 8703a0516f92819ea97d991984540332c061fe17
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Jul 22 21:47:42 2020 +0200
ensure psql fails hard if there is an error in the SQL (fixes #6437)
---
contrib/build-common | 2 +-
src/pq/pq_connect.c | 4 +++-
src/util/disk.c | 14 ++++++--------
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/contrib/build-common b/contrib/build-common
index d81bbfabc..1915a74bb 160000
--- a/contrib/build-common
+++ b/contrib/build-common
@@ -1 +1 @@
-Subproject commit d81bbfabc2538932f631d3946bd6a9b95182b4f2
+Subproject commit 1915a74bbb4cd2ae9bc541a382dfebc37064a2fd
diff --git a/src/pq/pq_connect.c b/src/pq/pq_connect.c
index e3a610922..881a158bb 100644
--- a/src/pq/pq_connect.c
+++ b/src/pq/pq_connect.c
@@ -172,6 +172,8 @@ apply_patch (struct GNUNET_PQ_Context *db,
"-f",
buf,
"-q",
+ "--set",
+ "ON_ERROR_STOP=1",
NULL);
if (NULL == psql)
{
@@ -415,7 +417,7 @@ GNUNET_PQ_reconnect (struct GNUNET_PQ_Context *db)
db->load_path))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Failed to load SQL statements from `%s'\n",
+ "Failed to load SQL statements from `%s*'\n",
db->load_path);
PQfinish (db->conn);
db->conn = NULL;
diff --git a/src/util/disk.c b/src/util/disk.c
index 6560726ea..c95e9753c 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1377,14 +1377,13 @@ GNUNET_DISK_file_map (const struct
GNUNET_DISK_FileHandle *h,
enum GNUNET_DISK_MapType access,
size_t len)
{
+ int prot;
+
if (NULL == h)
{
errno = EINVAL;
return NULL;
}
-
- int prot;
-
prot = 0;
if (access & GNUNET_DISK_MAP_TYPE_READ)
prot = PROT_READ;
@@ -1405,22 +1404,21 @@ GNUNET_DISK_file_map (const struct
GNUNET_DISK_FileHandle *h,
/**
* Unmap a file
+ *
* @param h mapping handle
- * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
*/
int
GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h)
{
int ret;
- if (h == NULL)
+ if (NULL == h)
{
errno = EINVAL;
return GNUNET_SYSERR;
}
-
ret = munmap (h->addr, h->len) != -1 ? GNUNET_OK : GNUNET_SYSERR;
-
GNUNET_free (h);
return ret;
}
@@ -1429,7 +1427,7 @@ GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h)
/**
* Write file changes to disk
* @param h handle to an open file
- * @return GNUNET_OK on success, GNUNET_SYSERR otherwise
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
*/
int
GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: ensure psql fails hard if there is an error in the SQL (fixes #6437),
gnunet <=