diff options
Diffstat (limited to 'src/state.c')
-rw-r--r-- | src/state.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/state.c b/src/state.c index 58aebf6..a662b8d 100644 --- a/src/state.c +++ b/src/state.c @@ -997,15 +997,15 @@ add_state_to_manifest(LilvWorld* lworld, LILV_ERRORF( "Failed to open %s for writing (%s)\n", manifest_path, strerror(errno)); r = 1; + } else { + SerdWriter* writer = ttl_file_writer(wfd, &manifest, &env); + zix_file_lock(wfd, ZIX_FILE_LOCK_BLOCK); + sord_write(model, writer, NULL); + zix_file_unlock(wfd, ZIX_FILE_LOCK_BLOCK); + serd_writer_free(writer); + fclose(wfd); } - SerdWriter* writer = ttl_file_writer(wfd, &manifest, &env); - zix_file_lock(wfd, ZIX_FILE_LOCK_BLOCK); - sord_write(model, writer, NULL); - zix_file_unlock(wfd, ZIX_FILE_LOCK_BLOCK); - serd_writer_free(writer); - fclose(wfd); - sord_free(model); serd_node_free(&file); serd_node_free(&manifest); |