Changes in uspace/lib/c/generic/io/io.c [79ae36dd:47b7006] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/io.c
r79ae36dd r47b7006 44 44 #include <io/klog.h> 45 45 #include <vfs/vfs.h> 46 #include <vfs/vfs_sess.h>47 46 #include <ipc/devmap.h> 48 47 #include <adt/list.h> 49 48 #include "../private/io.h" 50 #include "../private/stdio.h"51 49 52 50 static void _ffillbuf(FILE *stream); … … 58 56 .eof = true, 59 57 .klog = false, 60 . sess = NULL,58 .phone = -1, 61 59 .btype = _IONBF, 62 60 .buf = NULL, … … 72 70 .eof = false, 73 71 .klog = true, 74 . sess = NULL,72 .phone = -1, 75 73 .btype = _IOLBF, 76 74 .buf = NULL, … … 86 84 .eof = false, 87 85 .klog = true, 88 . sess = NULL,86 .phone = -1, 89 87 .btype = _IONBF, 90 88 .buf = NULL, … … 175 173 } 176 174 *flags = (O_APPEND | O_CREAT) | (plus ? O_RDWR : O_WRONLY); 177 break;178 175 default: 179 176 errno = EINVAL; … … 257 254 stream->eof = false; 258 255 stream->klog = false; 259 stream-> sess = NULL;256 stream->phone = -1; 260 257 stream->need_sync = false; 261 258 _setvbuf(stream); … … 279 276 stream->eof = false; 280 277 stream->klog = false; 281 stream-> sess = NULL;278 stream->phone = -1; 282 279 stream->need_sync = false; 283 280 _setvbuf(stream); … … 311 308 stream->eof = false; 312 309 stream->klog = false; 313 stream-> sess = NULL;310 stream->phone = -1; 314 311 stream->need_sync = false; 315 312 _setvbuf(stream); … … 326 323 fflush(stream); 327 324 328 if (stream-> sess != NULL)329 async_hangup(stream-> sess);325 if (stream->phone >= 0) 326 async_hangup(stream->phone); 330 327 331 328 if (stream->fd >= 0) … … 734 731 } 735 732 736 if ( (stream->fd >= 0) && (stream->need_sync)) {733 if (stream->fd >= 0 && stream->need_sync) { 737 734 /** 738 735 * Better than syncing always, but probably still not the … … 772 769 } 773 770 774 async_sess_t *fsession(exch_mgmt_t mgmt,FILE *stream)771 int fphone(FILE *stream) 775 772 { 776 773 if (stream->fd >= 0) { 777 if (stream-> sess == NULL)778 stream-> sess = fd_session(mgmt,stream->fd);779 780 return stream-> sess;781 } 782 783 return NULL;774 if (stream->phone < 0) 775 stream->phone = fd_phone(stream->fd); 776 777 return stream->phone; 778 } 779 780 return -1; 784 781 } 785 782
Note:
See TracChangeset
for help on using the changeset viewer.