diff options
author | Thomas White <taw@physics.org> | 2011-01-25 18:09:22 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:11 +0100 |
commit | 013103f6484935efb29ad2af0580bec3a0a859bd (patch) | |
tree | 3cc2a9022f433fa9edee60ceabaf37ee4a321cdf | |
parent | 25f550cd094b7698b9775210acc774db49d01a0d (diff) |
Tidy up DirAx autoindexing a little
-rw-r--r-- | src/dirax.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dirax.c b/src/dirax.c index aa748649..46c14a78 100644 --- a/src/dirax.c +++ b/src/dirax.c @@ -417,7 +417,7 @@ static void write_drx(struct image *image) fh = fopen(filename, "w"); if ( !fh ) { - ERROR("Couldn't open temporary file xfel.drx\n"); + ERROR("Couldn't open temporary file '%s'\n", filename); return; } fprintf(fh, "%f\n", 0.5); /* Lie about the wavelength. */ @@ -437,7 +437,6 @@ static void write_drx(struct image *image) } - void run_dirax(struct image *image) { unsigned int opts; @@ -448,6 +447,10 @@ void run_dirax(struct image *image) write_drx(image); dirax = malloc(sizeof(struct dirax_data)); + if ( dirax == NULL ) { + ERROR("Couldn't allocate memory for DirAx data.\n"); + return; + } dirax->pid = forkpty(&dirax->pty, NULL, NULL, NULL); if ( dirax->pid == -1 ) { @@ -515,6 +518,4 @@ void run_dirax(struct image *image) wait(&status); free(dirax); - - return; } |