summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/File.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-02-09 01:16:43 +0000
committerGreg Clayton <gclayton@apple.com>2011-02-09 01:16:43 +0000
commit925137cf842814a49e9ddd852348e645b9c42b1a (patch)
tree7db820aef0df4e5b69a4ce78593f7c7fcb7ca7a5 /lldb/source/Host/common/File.cpp
parent1305bc0a6572cf0b884fffe2c5aeb9e1a006ff3b (diff)
downloadbcm5719-llvm-925137cf842814a49e9ddd852348e645b9c42b1a.tar.gz
bcm5719-llvm-925137cf842814a49e9ddd852348e645b9c42b1a.zip
Pull support for the shared and exclusive lock since this wasn't available
on linux. And conditionalize the availablility of the fcntl() command F_GETPATH. llvm-svn: 125152
Diffstat (limited to 'lldb/source/Host/common/File.cpp')
-rw-r--r--lldb/source/Host/common/File.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index e2dd32cca00..e8ba529de94 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -13,6 +13,7 @@
#include <fcntl.h>
#include "lldb/Core/Error.h"
+#include "lldb/Host/Config.h"
#include "lldb/Host/FileSpec.h"
using namespace lldb;
@@ -202,13 +203,6 @@ File::Open (const char *path, uint32_t options, uint32_t permissions)
if (options & eOpenOptionCanCreateNewOnly)
oflag |= O_CREAT | O_EXCL;
-
- if (options & eOpenOptionSharedLock)
- oflag |= O_SHLOCK;
-
- if (options & eOpenOptionExclusiveLock)
- oflag |= O_EXLOCK;
-
mode_t mode = 0;
if (permissions & ePermissionsUserRead) mode |= S_IRUSR;
if (permissions & ePermissionsUserWrite) mode |= S_IWUSR;
@@ -262,6 +256,7 @@ Error
File::GetFileSpec (FileSpec &file_spec) const
{
Error error;
+#ifdef LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED
if (IsValid ())
{
char path[PATH_MAX];
@@ -271,7 +266,12 @@ File::GetFileSpec (FileSpec &file_spec) const
file_spec.SetFile (path, false);
}
else
+ {
error.SetErrorString("invalid file handle");
+ }
+#else
+ error.SetErrorString ("fcntl (fd, F_GETPATH, ...) is not supported on this platform");
+#endif
if (error.Fail())
file_spec.Clear();
OpenPOWER on IntegriCloud