From: Mikko L. <laz...@us...> - 2004-06-12 20:34:49
|
Update of /cvsroot/rtk/rtk/src/core/platform/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25085/core/platform/linux Modified Files: File.cpp Log Message: File works now under linux. (locking does not..) Index: File.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/platform/linux/File.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** File.cpp 12 Jun 2004 20:12:03 -0000 1.4 --- File.cpp 12 Jun 2004 20:34:40 -0000 1.5 *************** *** 64,68 **** #endif ! #define FD *((int*)_handle) File::File() --- 64,68 ---- #endif ! #define FD ((int)_handle) File::File() *************** *** 213,217 **** if(_mode & SYNC) open_flags |= O_SYNC; ! _handle = (void*) open(afile, open_flags); if(_mode & LOCKED) --- 213,217 ---- if(_mode & SYNC) open_flags |= O_SYNC; ! _handle = (void*) open(afile, open_flags, 0666); if(_mode & LOCKED) *************** *** 272,277 **** int read_bytes = 0; ! if( (read_bytes=read(FD, buffer, buffer_len)) >= 0) ! { _eos = (read_bytes == 0); return read_bytes; --- 272,278 ---- int read_bytes = 0; ! read_bytes = ::read(FD, buffer, buffer_len); ! //printf("FD = %d, read %d\n", FD, read_bytes); ! if (read_bytes >= 0) { _eos = (read_bytes == 0); return read_bytes; |