aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2016-07-28 11:07:19 +0200
committerThomas White <taw@physics.org>2016-07-28 16:17:50 +0200
commit9f7a7fc4571b1b57eee243d26b8778ac9556ffaf (patch)
treeb499f87cfe070fb3c9e2bc7c25eb42726904d30b /libcrystfel/src
parentbb89ebb6047ceb894188ff8a3a803210d4ee26c0 (diff)
Check return values when writing to Mosflm or DirAx
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/dirax.c4
-rw-r--r--libcrystfel/src/mosflm.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/libcrystfel/src/dirax.c b/libcrystfel/src/dirax.c
index 79b6d1ac..19f35696 100644
--- a/libcrystfel/src/dirax.c
+++ b/libcrystfel/src/dirax.c
@@ -292,7 +292,9 @@ static void dirax_sendline(const char *line, struct dirax_data *dirax)
free(copy);
#endif
- write(dirax->pty, line, strlen(line));
+ if ( write(dirax->pty, line, strlen(line)) == -1 ) {
+ ERROR("write() To dirax failed: %s\n", strerror(errno));
+ }
}
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index f1a1e8ae..f0a269ed 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -446,7 +446,9 @@ static void mosflm_sendline(const char *line, struct mosflm_data *mosflm)
free(copy);
#endif
- write(mosflm->pty, line, strlen(line));
+ if ( write(mosflm->pty, line, strlen(line)) == -1 ) {
+ ERROR("write() to MOSFLM failed: %s\n", strerror(errno));
+ }
}