diff options
Diffstat (limited to '')
| -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 |
