ugh, we need to make sure the file is opened for writing. or the flags

2003-03-14  Chris Toshok  <toshok@ximian.com>

	* gal/util/e-util.c (e_write_file): ugh, we need to make sure the
	file is opened for writing.  or the flags with O_WRONLY.

svn path=/trunk/; revision=20304
This commit is contained in:
Chris Toshok
2003-03-15 00:34:11 +00:00
committed by Chris Toshok
parent cb382f6c30
commit ec640140b3

View File

@ -198,7 +198,7 @@ e_write_file(const char *filename, const char *data, int flags)
int fd;
int length = strlen(data);
int bytes;
fd = open(filename, flags, 0666);
fd = open(filename, flags | O_WRONLY, 0666);
if (fd == -1)
return errno;
while (length > 0) {