diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2008-09-24 00:19:12 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2008-09-24 00:19:12 +0000 |
| commit | 17df4c2b9616c29865b0d893cc797d4938a660a2 (patch) | |
| tree | d31d62c5694279747909bbab2b8be93f01a7fb7b /src/file.cpp | |
| parent | 5230927c4f087cf2dcaac4fb9ed133c1ff3e2269 (diff) | |
| download | libbu++-17df4c2b9616c29865b0d893cc797d4938a660a2.tar.gz libbu++-17df4c2b9616c29865b0d893cc797d4938a660a2.tar.bz2 libbu++-17df4c2b9616c29865b0d893cc797d4938a660a2.tar.xz libbu++-17df4c2b9616c29865b0d893cc797d4938a660a2.zip | |
Wholly crap. Added the Fifo, fixed a bunch of bugs, made things more standard,
now I have a huge list of new functions to add. Also, we discovered that if
we add -W it produces more warnings, warnings about things that we'd like to
know about. I have a lot of work to go fixing that...
Diffstat (limited to 'src/file.cpp')
| -rw-r--r-- | src/file.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/file.cpp b/src/file.cpp index 3896005..83d76c5 100644 --- a/src/file.cpp +++ b/src/file.cpp | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <errno.h> | 10 | #include <errno.h> |
| 11 | #include <sys/types.h> | 11 | #include <sys/types.h> |
| 12 | #include <sys/stat.h> | 12 | #include <sys/stat.h> |
| 13 | #include <fcntl.h> | ||
| 13 | 14 | ||
| 14 | Bu::File::File( const char *sName, const char *sFlags ) | 15 | Bu::File::File( const char *sName, const char *sFlags ) |
| 15 | { | 16 | { |
| @@ -138,7 +139,16 @@ bool Bu::File::isBlocking() | |||
| 138 | 139 | ||
| 139 | void Bu::File::setBlocking( bool bBlocking ) | 140 | void Bu::File::setBlocking( bool bBlocking ) |
| 140 | { | 141 | { |
| 141 | return; | 142 | if( bBlocking ) |
| 143 | fcntl( | ||
| 144 | fileno( fh ), | ||
| 145 | F_SETFL, fcntl( fileno( fh ), F_GETFL, 0 )&(~O_NONBLOCK) | ||
| 146 | ); | ||
| 147 | else | ||
| 148 | fcntl( | ||
| 149 | fileno( fh ), | ||
| 150 | F_SETFL, fcntl( fileno( fh ), F_GETFL, 0 )|O_NONBLOCK | ||
| 151 | ); | ||
| 142 | } | 152 | } |
| 143 | 153 | ||
| 144 | #ifndef WIN32 | 154 | #ifndef WIN32 |
