mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-20 21:43:50 +00:00
Remove POSIX mkdir wrapper
Unused by now, use `<filesystem>` instead. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -55,11 +55,4 @@ extern int wopen(const OsPath& pathname, int oflag);
|
||||
extern int wopen(const OsPath& pathname, int oflag, mode_t mode);
|
||||
extern int wclose(int fd);
|
||||
|
||||
|
||||
//
|
||||
// sys/stat.h
|
||||
//
|
||||
|
||||
int wmkdir(const OsPath& path, mode_t mode);
|
||||
|
||||
#endif // #ifndef INCLUDED_SYSDEP_FILESYSTEM
|
||||
|
||||
@@ -97,8 +97,3 @@ int wrename(const OsPath& pathnameOld, const OsPath& pathnameNew)
|
||||
{
|
||||
return rename(OsString(pathnameOld).c_str(), OsString(pathnameNew).c_str());
|
||||
}
|
||||
|
||||
int wmkdir(const OsPath& path, mode_t mode)
|
||||
{
|
||||
return mkdir(OsString(path).c_str(), mode);
|
||||
}
|
||||
|
||||
@@ -129,34 +129,3 @@ int wclose(int fd)
|
||||
return _close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int ErrnoFromCreateDirectory()
|
||||
{
|
||||
switch(GetLastError())
|
||||
{
|
||||
case ERROR_ALREADY_EXISTS:
|
||||
return EEXIST;
|
||||
case ERROR_PATH_NOT_FOUND:
|
||||
return ENOENT;
|
||||
case ERROR_ACCESS_DENIED:
|
||||
return EACCES;
|
||||
case ERROR_WRITE_PROTECT:
|
||||
return EROFS;
|
||||
case ERROR_DIRECTORY:
|
||||
return ENOTDIR;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int wmkdir(const OsPath& path, mode_t)
|
||||
{
|
||||
if(!CreateDirectoryW(OsString(path).c_str(), (LPSECURITY_ATTRIBUTES)NULL))
|
||||
{
|
||||
errno = ErrnoFromCreateDirectory();
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user