diff options
author | Gabor X Toth <*@tg-x.net> | 2016-10-12 16:41:34 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-10-12 16:41:34 +0000 |
commit | 7b0570f80f6d176f760fca0a79e439ee84e7c5a9 (patch) | |
tree | 1b0da2077e1bebf03593fee4f64ad930d9b0b3ab /src/postgres | |
parent | 15c9fcd0f8110e515da3a34aaa6ac2778ff4cfb6 (diff) | |
download | gnunet-7b0570f80f6d176f760fca0a79e439ee84e7c5a9.tar.gz gnunet-7b0570f80f6d176f760fca0a79e439ee84e7c5a9.zip |
log: add \n
Diffstat (limited to 'src/postgres')
-rw-r--r-- | src/postgres/postgres.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/postgres/postgres.c b/src/postgres/postgres.c index 856031d75..4c8b2b046 100644 --- a/src/postgres/postgres.c +++ b/src/postgres/postgres.c | |||
@@ -43,10 +43,10 @@ | |||
43 | int | 43 | int |
44 | GNUNET_POSTGRES_check_result_ (PGconn *dbh, | 44 | GNUNET_POSTGRES_check_result_ (PGconn *dbh, |
45 | PGresult *ret, | 45 | PGresult *ret, |
46 | int expected_status, | 46 | int expected_status, |
47 | const char *command, | 47 | const char *command, |
48 | const char *args, | 48 | const char *args, |
49 | const char *filename, | 49 | const char *filename, |
50 | int line) | 50 | int line) |
51 | { | 51 | { |
52 | if (ret == NULL) | 52 | if (ret == NULL) |
@@ -60,7 +60,7 @@ GNUNET_POSTGRES_check_result_ (PGconn *dbh, | |||
60 | if (PQresultStatus (ret) != expected_status) | 60 | if (PQresultStatus (ret) != expected_status) |
61 | { | 61 | { |
62 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, | 62 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, |
63 | "postgres", _("`%s:%s' failed at %s:%d with error: %s"), | 63 | "postgres", _("`%s:%s' failed at %s:%d with error: %s\n"), |
64 | command, args, filename, line, PQerrorMessage (dbh)); | 64 | command, args, filename, line, PQerrorMessage (dbh)); |
65 | PQclear (ret); | 65 | PQclear (ret); |
66 | return GNUNET_SYSERR; | 66 | return GNUNET_SYSERR; |
@@ -79,8 +79,8 @@ GNUNET_POSTGRES_check_result_ (PGconn *dbh, | |||
79 | * @return #GNUNET_OK on success | 79 | * @return #GNUNET_OK on success |
80 | */ | 80 | */ |
81 | int | 81 | int |
82 | GNUNET_POSTGRES_exec_ (PGconn * dbh, | 82 | GNUNET_POSTGRES_exec_ (PGconn * dbh, |
83 | const char *sql, | 83 | const char *sql, |
84 | const char *filename, | 84 | const char *filename, |
85 | int line) | 85 | int line) |
86 | { | 86 | { |
@@ -109,25 +109,25 @@ GNUNET_POSTGRES_exec_ (PGconn * dbh, | |||
109 | */ | 109 | */ |
110 | int | 110 | int |
111 | GNUNET_POSTGRES_prepare_ (PGconn *dbh, | 111 | GNUNET_POSTGRES_prepare_ (PGconn *dbh, |
112 | const char *name, | 112 | const char *name, |
113 | const char *sql, | 113 | const char *sql, |
114 | int nparams, | 114 | int nparams, |
115 | const char *filename, | 115 | const char *filename, |
116 | int line) | 116 | int line) |
117 | { | 117 | { |
118 | PGresult *ret; | 118 | PGresult *ret; |
119 | 119 | ||
120 | ret = PQprepare (dbh, | 120 | ret = PQprepare (dbh, |
121 | name, | 121 | name, |
122 | sql, | 122 | sql, |
123 | nparams, NULL); | 123 | nparams, NULL); |
124 | if (GNUNET_OK != | 124 | if (GNUNET_OK != |
125 | GNUNET_POSTGRES_check_result_ (dbh, | 125 | GNUNET_POSTGRES_check_result_ (dbh, |
126 | ret, | 126 | ret, |
127 | PGRES_COMMAND_OK, | 127 | PGRES_COMMAND_OK, |
128 | "PQprepare", | 128 | "PQprepare", |
129 | sql, | 129 | sql, |
130 | filename, | 130 | filename, |
131 | line)) | 131 | line)) |
132 | return GNUNET_SYSERR; | 132 | return GNUNET_SYSERR; |
133 | PQclear (ret); | 133 | PQclear (ret); |
@@ -163,7 +163,7 @@ GNUNET_POSTGRES_connect (const struct GNUNET_CONFIGURATION_Handle * cfg, | |||
163 | if (PQstatus (dbh) != CONNECTION_OK) | 163 | if (PQstatus (dbh) != CONNECTION_OK) |
164 | { | 164 | { |
165 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "postgres", | 165 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, "postgres", |
166 | _("Unable to initialize Postgres: %s"), | 166 | _("Unable to initialize Postgres: %s\n"), |
167 | PQerrorMessage (dbh)); | 167 | PQerrorMessage (dbh)); |
168 | PQfinish (dbh); | 168 | PQfinish (dbh); |
169 | return NULL; | 169 | return NULL; |
@@ -182,7 +182,7 @@ GNUNET_POSTGRES_connect (const struct GNUNET_CONFIGURATION_Handle * cfg, | |||
182 | * @return #GNUNET_OK on success | 182 | * @return #GNUNET_OK on success |
183 | */ | 183 | */ |
184 | int | 184 | int |
185 | GNUNET_POSTGRES_delete_by_rowid (PGconn * dbh, | 185 | GNUNET_POSTGRES_delete_by_rowid (PGconn * dbh, |
186 | const char *stmt, | 186 | const char *stmt, |
187 | uint32_t rowid) | 187 | uint32_t rowid) |
188 | { | 188 | { |
@@ -193,15 +193,15 @@ GNUNET_POSTGRES_delete_by_rowid (PGconn * dbh, | |||
193 | PGresult *ret; | 193 | PGresult *ret; |
194 | 194 | ||
195 | ret = | 195 | ret = |
196 | PQexecPrepared (dbh, stmt, 1, | 196 | PQexecPrepared (dbh, stmt, 1, |
197 | paramValues, | 197 | paramValues, |
198 | paramLengths, | 198 | paramLengths, |
199 | paramFormats, | 199 | paramFormats, |
200 | 1); | 200 | 1); |
201 | if (GNUNET_OK != | 201 | if (GNUNET_OK != |
202 | GNUNET_POSTGRES_check_result_ (dbh, ret, | 202 | GNUNET_POSTGRES_check_result_ (dbh, ret, |
203 | PGRES_COMMAND_OK, | 203 | PGRES_COMMAND_OK, |
204 | "PQexecPrepared", | 204 | "PQexecPrepared", |
205 | "delrow", | 205 | "delrow", |
206 | __FILE__, | 206 | __FILE__, |
207 | __LINE__)) | 207 | __LINE__)) |