Commit b8a62a85 b8a62a85c1156cd23228360b3478f00081c62189 by Alain Magloire

Race condition call lazy_create () before file_stream_create()

	since now stream_open() does not do anything.
1 parent ec016ae5
2001-12-16 Alain Magloire
* mailbox/body.c: Call lazy_create() _before__ file_stream_create()
to create the temporary file.
2001-12-16 Sam Roberts
* comsat/: comsat.c
......
......@@ -150,12 +150,13 @@ body_get_stream (body_t body, stream_t *pstream)
int status = stream_create (&body->stream, MU_STREAM_RDWR, body);
if (status != 0)
return status;
status = file_stream_create (&body->fstream, body->filename, MU_STREAM_RDWR);
if (status != 0)
return status;
/* Create the temporary file. */
fd = lazy_create (body);
if (fd == -1)
return errno;
status = file_stream_create (&body->fstream, body->filename, MU_STREAM_RDWR);
if (status != 0)
return status;
status = stream_open (body->fstream);
close (fd);
if (status != 0)
......