aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/mosflm.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-07-23 15:00:33 +0200
committerThomas White <taw@physics.org>2012-07-23 15:00:33 +0200
commit9964cdeafc1338f5841270bc5392ad8e3c8eb33e (patch)
tree0fe784c1f27967034690b32bc67cb4426d79aae3 /libcrystfel/src/mosflm.c
parente63626f4207fa58d3ea70b68f2862630d281598d (diff)
parent6eb751c2230226723884cc7bc473d65b91064b81 (diff)
Merge branch 'tom/speed'
Diffstat (limited to 'libcrystfel/src/mosflm.c')
-rw-r--r--libcrystfel/src/mosflm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index 410b779a..ed118aa4 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -379,7 +379,6 @@ static int mosflm_readable(struct image *image, struct mosflm_data *mosflm)
rval = read(mosflm->pty, mosflm->rbuffer+mosflm->rbufpos,
mosflm->rbuflen-mosflm->rbufpos);
-
if ( (rval == -1) || (rval == 0) ) return 1;
mosflm->rbufpos += rval;
@@ -436,7 +435,6 @@ static int mosflm_readable(struct image *image, struct mosflm_data *mosflm)
break;
case MOSFLM_INPUT_PROMPT :
-
mosflm_send_next(image, mosflm);
endbit_length = i+7;
break;
@@ -513,6 +511,7 @@ void run_mosflm(struct image *image, UnitCell *cell)
remove(mosflm->newmatfile);
mosflm->pid = forkpty(&mosflm->pty, NULL, NULL, NULL);
+
if ( mosflm->pid == -1 ) {
ERROR("Failed to fork for MOSFLM\n");
free(mosflm);
@@ -545,6 +544,7 @@ void run_mosflm(struct image *image, UnitCell *cell)
mosflm->step = 1; /* This starts the "initialisation" procedure */
mosflm->finished_ok = 0;
+
do {
fd_set fds;
@@ -559,7 +559,7 @@ void run_mosflm(struct image *image, UnitCell *cell)
sval = select(mosflm->pty+1, &fds, NULL, NULL, &tv);
- if ( sval == -1 ) {
+ if ( sval == -1 ) {
int err = errno;
ERROR("select() failed: %s\n", strerror(err));
rval = 1;
@@ -570,6 +570,7 @@ void run_mosflm(struct image *image, UnitCell *cell)
rval = 1;
}
+
} while ( !rval );
close(mosflm->pty);