Changeset 1564c4b in mainline for uspace/lib/c/generic/io/io.c
- Timestamp:
- 2011-06-08T19:39:52Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2af29ed
- Parents:
- e686889c (diff), 0eff68e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/io.c
re686889c r1564c4b 44 44 #include <io/klog.h> 45 45 #include <vfs/vfs.h> 46 #include <vfs/vfs_sess.h> 46 47 #include <ipc/devmap.h> 47 48 #include <adt/list.h> 48 49 #include "../private/io.h" 50 #include "../private/stdio.h" 49 51 50 52 static void _ffillbuf(FILE *stream); … … 56 58 .eof = true, 57 59 .klog = false, 58 . phone = -1,60 .sess = NULL, 59 61 .btype = _IONBF, 60 62 .buf = NULL, … … 70 72 .eof = false, 71 73 .klog = true, 72 . phone = -1,74 .sess = NULL, 73 75 .btype = _IOLBF, 74 76 .buf = NULL, … … 84 86 .eof = false, 85 87 .klog = true, 86 . phone = -1,88 .sess = NULL, 87 89 .btype = _IONBF, 88 90 .buf = NULL, … … 173 175 } 174 176 *flags = (O_APPEND | O_CREAT) | (plus ? O_RDWR : O_WRONLY); 177 break; 175 178 default: 176 179 errno = EINVAL; … … 254 257 stream->eof = false; 255 258 stream->klog = false; 256 stream-> phone = -1;259 stream->sess = NULL; 257 260 stream->need_sync = false; 258 261 _setvbuf(stream); … … 276 279 stream->eof = false; 277 280 stream->klog = false; 278 stream-> phone = -1;281 stream->sess = NULL; 279 282 stream->need_sync = false; 280 283 _setvbuf(stream); … … 308 311 stream->eof = false; 309 312 stream->klog = false; 310 stream-> phone = -1;313 stream->sess = NULL; 311 314 stream->need_sync = false; 312 315 _setvbuf(stream); … … 323 326 fflush(stream); 324 327 325 if (stream-> phone >= 0)326 async_hangup(stream-> phone);328 if (stream->sess != NULL) 329 async_hangup(stream->sess); 327 330 328 331 if (stream->fd >= 0) … … 731 734 } 732 735 733 if ( stream->fd >= 0 && stream->need_sync) {736 if ((stream->fd >= 0) && (stream->need_sync)) { 734 737 /** 735 738 * Better than syncing always, but probably still not the … … 769 772 } 770 773 771 int fphone(FILE *stream)774 async_sess_t *fsession(exch_mgmt_t mgmt, FILE *stream) 772 775 { 773 776 if (stream->fd >= 0) { 774 if (stream-> phone < 0)775 stream-> phone = fd_phone(stream->fd);776 777 return stream-> phone;778 } 779 780 return -1;777 if (stream->sess == NULL) 778 stream->sess = fd_session(mgmt, stream->fd); 779 780 return stream->sess; 781 } 782 783 return NULL; 781 784 } 782 785
Note:
See TracChangeset
for help on using the changeset viewer.