Changes in uspace/lib/c/generic/io/io.c [76d6169:2f72c67a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/io.c
r76d6169 r2f72c67a 45 45 #include <vfs/vfs.h> 46 46 #include <vfs/vfs_sess.h> 47 #include <ipc/ devmap.h>47 #include <ipc/loc.h> 48 48 #include <adt/list.h> 49 49 #include "../private/io.h" … … 418 418 419 419 bytes_used = stream->buf_head - stream->buf_tail; 420 if (bytes_used == 0)421 return;422 420 423 421 /* If buffer has prefetched read data, we need to seek back. */ 424 if ( stream->buf_state == _bs_read)422 if (bytes_used > 0 && stream->buf_state == _bs_read) 425 423 lseek(stream->fd, - (ssize_t) bytes_used, SEEK_CUR); 426 424 427 425 /* If buffer has unwritten data, we need to write them out. */ 428 if ( stream->buf_state == _bs_write)426 if (bytes_used > 0 && stream->buf_state == _bs_write) 429 427 (void) _fwrite(stream->buf_tail, 1, bytes_used, stream); 430 428
Note:
See TracChangeset
for help on using the changeset viewer.