Kaynağa Gözat

src/common/utils.c: flag O_RDWR is not necessary when calling mkostemp, and it fails on freebsd systems

Nathalie Furmento 8 yıl önce
ebeveyn
işleme
a85622207e
1 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 2 1
      src/common/utils.c

+ 2 - 1
src/common/utils.c

@@ -205,6 +205,7 @@ char *_starpu_mktemp(const char *directory, int flags, int *fd)
 	_mktemp(baseCpy);
 	*fd = open(baseCpy, flags);
 #elif defined (HAVE_MKOSTEMP)
+	flags &= ~O_RDWR;
 	*fd = mkostemp(baseCpy, flags);
 #else
 #  ifdef O_DIRECT
@@ -219,7 +220,7 @@ char *_starpu_mktemp(const char *directory, int flags, int *fd)
 	if (*fd < 0)
 	{
 		int err = errno;
-		_STARPU_DISP("Could not create temporary file in directory '%s', mskostemp failed with error '%s'\n", directory, strerror(errno));
+		_STARPU_DISP("Could not create temporary file in directory '%s', mk[o]stemp failed with error '%s'\n", directory, strerror(errno));
 		free(baseCpy);
 		errno = err;
 		return NULL;