Selaa lähdekoodia

report correct error on Windows

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38216 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 16 vuotta sitten
vanhempi
commit
536712efea
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      lib/iostream/ami_stream.cc

+ 5 - 1
lib/iostream/ami_stream.cc

@@ -84,12 +84,16 @@ ami_single_temp_name(const std::string& base, char* tmp_path) {
 #ifdef __MINGW32__
 #ifdef __MINGW32__
   fd = mktemp(tmp_path) ? open(tmp_path, O_CREAT|O_EXCL|O_RDWR, 0600) : -1;
   fd = mktemp(tmp_path) ? open(tmp_path, O_CREAT|O_EXCL|O_RDWR, 0600) : -1;
 #else
 #else
-  fd  = mkstemp(tmp_path);
+  fd = mkstemp(tmp_path);
 #endif
 #endif
 
 
   if (fd == -1) {
   if (fd == -1) {
     cerr <<  "ami_single_temp_name: ";
     cerr <<  "ami_single_temp_name: ";
+#ifdef __MINGW32__
+    perror("mktemp failed: ");
+#else
     perror("mkstemp failed: ");
     perror("mkstemp failed: ");
+#endif
     assert(0);
     assert(0);
     exit(1);
     exit(1);
   }
   }