aboutsummaryrefslogtreecommitdiff
path: root/src/file.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2008-10-02 13:13:03 +0000
committerMike Buland <eichlan@xagasoft.com>2008-10-02 13:13:03 +0000
commit7ae633f8a997997524cded2d205d14eeb5f08051 (patch)
tree7e773bd0b4a1aea83534a6ce5c80c9f4269e20f5 /src/file.cpp
parentb6f57560fb7fae00f0854ca19158bd5512e5405b (diff)
downloadlibbu++-7ae633f8a997997524cded2d205d14eeb5f08051.tar.gz
libbu++-7ae633f8a997997524cded2d205d14eeb5f08051.tar.bz2
libbu++-7ae633f8a997997524cded2d205d14eeb5f08051.tar.xz
libbu++-7ae633f8a997997524cded2d205d14eeb5f08051.zip
Updated on my laptop and discovered that the new, more pedantic gcc had a
problem with a missing include. Also, if you get errors about conflicts and things being declared twice, then "rm src/exceptions.o" it shouldn't be sneaking in there still, but it may be. then do a full "build -c all" and build. Oh, also found some solid gold taf code that never got included, but is very much needed. Remembering to commit would be useful...
Diffstat (limited to 'src/file.cpp')
-rw-r--r--src/file.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/file.cpp b/src/file.cpp
index 5049bbb..417c445 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -11,6 +11,7 @@
11#include <sys/stat.h> 11#include <sys/stat.h>
12#include <fcntl.h> 12#include <fcntl.h>
13#include <unistd.h> 13#include <unistd.h>
14#include <stdlib.h> // for mkstemp
14 15
15namespace Bu { subExceptionDef( FileException ) } 16namespace Bu { subExceptionDef( FileException ) }
16 17
@@ -150,6 +151,12 @@ void Bu::File::setBlocking( bool bBlocking )
150} 151}
151 152
152#ifndef WIN32 153#ifndef WIN32
154Bu::File Bu::File::tempFile( Bu::FString &sName, int /*iFlags*/ )
155{
156 int afh_d = mkstemp( sName.getStr() );
157
158 return Bu::File( afh_d );
159}
153void Bu::File::truncate( long nSize ) 160void Bu::File::truncate( long nSize )
154{ 161{
155 ftruncate( fd, nSize ); 162 ftruncate( fd, nSize );