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
1 2001-12-16 Alain Magloire
2
3 * mailbox/body.c: Call lazy_create() _before__ file_stream_create()
4 to create the temporary file.
5
1 2001-12-16 Sam Roberts 6 2001-12-16 Sam Roberts
2 7
3 * comsat/: comsat.c 8 * comsat/: comsat.c
......
...@@ -150,12 +150,13 @@ body_get_stream (body_t body, stream_t *pstream) ...@@ -150,12 +150,13 @@ body_get_stream (body_t body, stream_t *pstream)
150 int status = stream_create (&body->stream, MU_STREAM_RDWR, body); 150 int status = stream_create (&body->stream, MU_STREAM_RDWR, body);
151 if (status != 0) 151 if (status != 0)
152 return status; 152 return status;
153 status = file_stream_create (&body->fstream, body->filename, MU_STREAM_RDWR); 153 /* Create the temporary file. */
154 if (status != 0)
155 return status;
156 fd = lazy_create (body); 154 fd = lazy_create (body);
157 if (fd == -1) 155 if (fd == -1)
158 return errno; 156 return errno;
157 status = file_stream_create (&body->fstream, body->filename, MU_STREAM_RDWR);
158 if (status != 0)
159 return status;
159 status = stream_open (body->fstream); 160 status = stream_open (body->fstream);
160 close (fd); 161 close (fd);
161 if (status != 0) 162 if (status != 0)
......