diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-07-18 00:44:39 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-07-18 00:44:39 +0200 |
commit | 7f4ddbcab8598e3d5e29c23ce883cdfa664408f1 (patch) | |
tree | 5f1b18463f641f24fad519e0aefb60b97d707b52 /src/fs | |
parent | 28ab2c446fba4980a8295d59fdf203a028a35dd6 (diff) | |
download | gnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.tar.gz gnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.zip |
merge flags into enum for GNUNET_DISK_pipe() API, fixing #6188
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs_namespace.c | 22 | ||||
-rw-r--r-- | src/fs/gnunet-auto-share.c | 11 |
2 files changed, 17 insertions, 16 deletions
diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c index 508f9cadc..155486be5 100644 --- a/src/fs/fs_namespace.c +++ b/src/fs/fs_namespace.c | |||
@@ -214,13 +214,13 @@ write_update_information_graph (struct GNUNET_FS_UpdateInformationGraph *uig) | |||
214 | n = uig->update_nodes[i]; | 214 | n = uig->update_nodes[i]; |
215 | uris = GNUNET_FS_uri_to_string (n->uri); | 215 | uris = GNUNET_FS_uri_to_string (n->uri); |
216 | struct GNUNET_BIO_WriteSpec ws[] = { | 216 | struct GNUNET_BIO_WriteSpec ws[] = { |
217 | GNUNET_BIO_write_spec_string("fs-namespace-node-id", n->id), | 217 | GNUNET_BIO_write_spec_string ("fs-namespace-node-id", n->id), |
218 | GNUNET_BIO_write_spec_meta_data("fs-namespace-node-meta", n->md), | 218 | GNUNET_BIO_write_spec_meta_data ("fs-namespace-node-meta", n->md), |
219 | GNUNET_BIO_write_spec_string("fs-namespace-node-update", n->update), | 219 | GNUNET_BIO_write_spec_string ("fs-namespace-node-update", n->update), |
220 | GNUNET_BIO_write_spec_string("fs-namespace-uris", uris), | 220 | GNUNET_BIO_write_spec_string ("fs-namespace-uris", uris), |
221 | GNUNET_BIO_write_spec_end(), | 221 | GNUNET_BIO_write_spec_end (), |
222 | }; | 222 | }; |
223 | if (GNUNET_OK != GNUNET_BIO_write_spec_commit(wh, ws)) | 223 | if (GNUNET_OK != GNUNET_BIO_write_spec_commit (wh, ws)) |
224 | { | 224 | { |
225 | GNUNET_free (uris); | 225 | GNUNET_free (uris); |
226 | break; | 226 | break; |
@@ -292,11 +292,11 @@ read_update_information_graph (struct GNUNET_FS_Handle *h, | |||
292 | { | 292 | { |
293 | n = GNUNET_new (struct NamespaceUpdateNode); | 293 | n = GNUNET_new (struct NamespaceUpdateNode); |
294 | struct GNUNET_BIO_ReadSpec rs[] = { | 294 | struct GNUNET_BIO_ReadSpec rs[] = { |
295 | GNUNET_BIO_read_spec_string("identifier", &n->id, 1024), | 295 | GNUNET_BIO_read_spec_string ("identifier", &n->id, 1024), |
296 | GNUNET_BIO_read_spec_meta_data("meta", &n->md), | 296 | GNUNET_BIO_read_spec_meta_data ("meta", &n->md), |
297 | GNUNET_BIO_read_spec_string("update-id", &n->update, 1024), | 297 | GNUNET_BIO_read_spec_string ("update-id", &n->update, 1024), |
298 | GNUNET_BIO_read_spec_string("uri", &uris, 1024 * 2), | 298 | GNUNET_BIO_read_spec_string ("uri", &uris, 1024 * 2), |
299 | GNUNET_BIO_read_spec_end(), | 299 | GNUNET_BIO_read_spec_end (), |
300 | }; | 300 | }; |
301 | if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs)) | 301 | if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs)) |
302 | { | 302 | { |
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index 41dfe781a..f91e9d00d 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c | |||
@@ -201,9 +201,9 @@ load_state () | |||
201 | while (n-- > 0) | 201 | while (n-- > 0) |
202 | { | 202 | { |
203 | struct GNUNET_BIO_ReadSpec rs[] = { | 203 | struct GNUNET_BIO_ReadSpec rs[] = { |
204 | GNUNET_BIO_read_spec_string("filename", &fn, 1024), | 204 | GNUNET_BIO_read_spec_string ("filename", &fn, 1024), |
205 | GNUNET_BIO_read_spec_object("id", &id, sizeof(struct GNUNET_HashCode)), | 205 | GNUNET_BIO_read_spec_object ("id", &id, sizeof(struct GNUNET_HashCode)), |
206 | GNUNET_BIO_read_spec_end(), | 206 | GNUNET_BIO_read_spec_end (), |
207 | }; | 207 | }; |
208 | if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs)) | 208 | if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs)) |
209 | goto error; | 209 | goto error; |
@@ -258,7 +258,8 @@ write_item (void *cls, const struct GNUNET_HashCode *key, void *value) | |||
258 | struct GNUNET_BIO_WriteSpec ws[] = { | 258 | struct GNUNET_BIO_WriteSpec ws[] = { |
259 | GNUNET_BIO_write_spec_string ("auto-share-write-item-filename", | 259 | GNUNET_BIO_write_spec_string ("auto-share-write-item-filename", |
260 | wi->filename), | 260 | wi->filename), |
261 | GNUNET_BIO_write_spec_object ("id", &wi->id, sizeof(struct GNUNET_HashCode)), | 261 | GNUNET_BIO_write_spec_object ("id", &wi->id, sizeof(struct |
262 | GNUNET_HashCode)), | ||
262 | GNUNET_BIO_write_spec_end (), | 263 | GNUNET_BIO_write_spec_end (), |
263 | }; | 264 | }; |
264 | if (GNUNET_OK != GNUNET_BIO_write_spec_commit (wh, ws)) | 265 | if (GNUNET_OK != GNUNET_BIO_write_spec_commit (wh, ws)) |
@@ -747,7 +748,7 @@ main (int argc, char *const *argv) | |||
747 | 748 | ||
748 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 749 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) |
749 | return 2; | 750 | return 2; |
750 | sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); | 751 | sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE); |
751 | GNUNET_assert (NULL != sigpipe); | 752 | GNUNET_assert (NULL != sigpipe); |
752 | shc_chld = | 753 | shc_chld = |
753 | GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); | 754 | GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); |