]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/win32/compat/compat.cpp
Fix create_file.c Win32 problem pointed out by
[bacula/bacula] / bacula / src / win32 / compat / compat.cpp
index c2123ea577ea2335dc4ec8c8cf9927cafada768d..cf2609cba394b7d17cc5e725acc43c99374005c2 100644 (file)
@@ -1375,6 +1375,22 @@ utime(const char *fname, struct utimbuf *times)
 
 #if USE_WIN32_COMPAT_IO
 
+int
+unlink(const char *file)
+{
+   int nRetCode;
+   if (p_wunlink) {
+      WCHAR szBuf[MAX_PATH_UNICODE];
+      UTF8_2_wchar(szBuf, attr->ofname, MAX_PATH_UNICODE);
+
+      nRetCode = _wunlink(szBuf);
+   } else {
+      nRetCode = _unlink(attr->ofname);
+   }
+   return nRetCode;
+}
+
+
 int
 open(const char *file, int flags, int mode)
 {
@@ -1414,6 +1430,7 @@ write(int fd, const void *buf, ssize_t len)
 }
 #endif
 
+
 off_t
 lseek(int fd, off_t offset, int whence)
 {