projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d1941a
)
Support/raw_ostream: Fix uninitalized variable in raw_fd_ostream constructor.
author
Michael J. Spencer
<bigcheesegs@gmail.com>
Mon, 17 Jan 2011 15:53:12 +0000
(15:53 +0000)
committer
Michael J. Spencer
<bigcheesegs@gmail.com>
Mon, 17 Jan 2011 15:53:12 +0000
(15:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123643
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/raw_ostream.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/raw_ostream.cpp
b/lib/Support/raw_ostream.cpp
index 0279f40cabad0f6465a8fb5bfa19107edf169a50..e7d75e712860bc47188a126f2422d38a20b3cb35 100644
(file)
--- a/
lib/Support/raw_ostream.cpp
+++ b/
lib/Support/raw_ostream.cpp
@@
-433,6
+433,13
@@
raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered)
if (fd == STDOUT_FILENO || fd == STDERR_FILENO)
setmode(fd, O_BINARY);
#endif
+
+ // Get the starting position.
+ off_t loc = ::lseek(FD, 0, SEEK_CUR);
+ if (loc == (off_t)-1)
+ pos = 0;
+ else
+ pos = static_cast<uint64_t>(loc);
}
raw_fd_ostream::~raw_fd_ostream() {