aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorValerio Mariani <valerio.mariani@desy.de>2014-11-24 15:25:12 +0100
committerThomas White <taw@physics.org>2014-11-24 16:05:16 +0100
commit67cc5f23e11cec85747fb770fbca24b541b4bfde (patch)
tree61dc71a2f00f9ad1f928e27c55427af825653db5 /src
parent225f2f78c0f0606ec3b1d305ff084df950b0c6f5 (diff)
Fixed stream I/O across different versions
Diffstat (limited to 'src')
-rw-r--r--src/partial_sim.c6
-rw-r--r--src/process_image.c11
2 files changed, 13 insertions, 4 deletions
diff --git a/src/partial_sim.c b/src/partial_sim.c
index 1252cd86..6e5f1ced 100644
--- a/src/partial_sim.c
+++ b/src/partial_sim.c
@@ -390,8 +390,12 @@ static void finalise_job(void *vqargs, void *vwargs)
struct worker_args *wargs = vwargs;
struct queue_args *qargs = vqargs;
int i;
+ int ret;
- write_chunk(qargs->stream, &wargs->image, NULL, 0, 1, NULL);
+ ret = write_chunk(qargs->stream, &wargs->image, NULL, 0, 1, NULL);
+ if ( ret != 0) {
+ ERROR("Warning: error writing stream file.\n");
+ }
for ( i=0; i<NBINS; i++ ) {
qargs->n_ref[i] += wargs->n_ref[i];
diff --git a/src/process_image.c b/src/process_image.c
index 807facd9..f09d06b4 100644
--- a/src/process_image.c
+++ b/src/process_image.c
@@ -122,6 +122,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
struct image image;
int i;
int r;
+ int ret;
char *rn;
image.features = NULL;
@@ -252,9 +253,13 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
iargs->int_diag_k, iargs->int_diag_l,
results_pipe);
- write_chunk(st, &image, hdfile,
- iargs->stream_peaks, iargs->stream_refls,
- pargs->filename_p_e->ev);
+ ret = write_chunk(st, &image, hdfile,
+ iargs->stream_peaks, iargs->stream_refls,
+ pargs->filename_p_e->ev);
+ if ( ret != 0 ) {
+ ERROR("Error writing stream file.\n");
+ }
+
for ( i=0; i<image.n_crystals; i++ ) {
cell_free(crystal_get_cell(image.crystals[i]));