mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 06:25:18 +00:00
Remove last use of PathV1.h from Archive.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184484 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -153,6 +153,8 @@ class file_status
|
|||||||
dev_t fs_st_dev;
|
dev_t fs_st_dev;
|
||||||
ino_t fs_st_ino;
|
ino_t fs_st_ino;
|
||||||
time_t fs_st_mtime;
|
time_t fs_st_mtime;
|
||||||
|
uid_t fs_st_uid;
|
||||||
|
gid_t fs_st_gid;
|
||||||
#elif defined (LLVM_ON_WIN32)
|
#elif defined (LLVM_ON_WIN32)
|
||||||
uint32_t LastWriteTimeHigh;
|
uint32_t LastWriteTimeHigh;
|
||||||
uint32_t LastWriteTimeLow;
|
uint32_t LastWriteTimeLow;
|
||||||
@@ -177,6 +179,18 @@ public:
|
|||||||
perms permissions() const { return Perms; }
|
perms permissions() const { return Perms; }
|
||||||
TimeValue getLastModificationTime() const;
|
TimeValue getLastModificationTime() const;
|
||||||
|
|
||||||
|
#if defined(LLVM_ON_UNIX)
|
||||||
|
uint32_t getUser() const { return fs_st_uid; }
|
||||||
|
uint32_t getGroup() const { return fs_st_gid; }
|
||||||
|
#elif defined (LLVM_ON_WIN32)
|
||||||
|
uint32_t getUser() const {
|
||||||
|
return 9999; // Not applicable to Windows, so...
|
||||||
|
}
|
||||||
|
uint32_t getGroup() const {
|
||||||
|
return 9999; // Not applicable to Windows, so...
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
void type(file_type v) { Type = v; }
|
void type(file_type v) { Type = v; }
|
||||||
void permissions(perms p) { Perms = p; }
|
void permissions(perms p) { Perms = p; }
|
||||||
|
@@ -408,6 +408,8 @@ error_code status(const Twine &path, file_status &result) {
|
|||||||
result.fs_st_dev = status.st_dev;
|
result.fs_st_dev = status.st_dev;
|
||||||
result.fs_st_ino = status.st_ino;
|
result.fs_st_ino = status.st_ino;
|
||||||
result.fs_st_mtime = status.st_mtime;
|
result.fs_st_mtime = status.st_mtime;
|
||||||
|
result.fs_st_uid = status.st_uid;
|
||||||
|
result.fs_st_gid = status.st_gid;
|
||||||
|
|
||||||
return error_code::success();
|
return error_code::success();
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
#include "llvm/IR/Module.h"
|
#include "llvm/IR/Module.h"
|
||||||
#include "llvm/Support/FileSystem.h"
|
#include "llvm/Support/FileSystem.h"
|
||||||
#include "llvm/Support/MemoryBuffer.h"
|
#include "llvm/Support/MemoryBuffer.h"
|
||||||
#include "llvm/Support/PathV1.h"
|
|
||||||
#include "llvm/Support/Process.h"
|
#include "llvm/Support/Process.h"
|
||||||
#include "llvm/Support/system_error.h"
|
#include "llvm/Support/system_error.h"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@@ -109,15 +108,21 @@ bool ArchiveMember::replaceWith(StringRef newFile, std::string* ErrMsg) {
|
|||||||
if (!signature) {
|
if (!signature) {
|
||||||
sys::fs::get_magic(path, magic.capacity(), magic);
|
sys::fs::get_magic(path, magic.capacity(), magic);
|
||||||
signature = magic.c_str();
|
signature = magic.c_str();
|
||||||
sys::PathWithStatus PWS(path);
|
|
||||||
const sys::FileStatus *FSinfo = PWS.getFileStatus(false, ErrMsg);
|
sys::fs::file_status Status;
|
||||||
if (!FSinfo)
|
error_code EC = sys::fs::status(path, Status);
|
||||||
|
if (EC)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
User = Status.getUser();
|
||||||
|
Group = Status.getGroup();
|
||||||
|
Mode = Status.permissions();
|
||||||
|
ModTime = Status.getLastModificationTime();
|
||||||
|
|
||||||
|
// FIXME: On posix this is a second stat.
|
||||||
|
EC = sys::fs::file_size(path, Size);
|
||||||
|
if (EC)
|
||||||
return true;
|
return true;
|
||||||
User = FSinfo->getUser();
|
|
||||||
Group = FSinfo->getGroup();
|
|
||||||
Mode = FSinfo->getMode();
|
|
||||||
ModTime = FSinfo->getTimestamp();
|
|
||||||
Size = FSinfo->getSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine what kind of file it is.
|
// Determine what kind of file it is.
|
||||||
|
Reference in New Issue
Block a user