version 1.1, 2009/07/25 08:44:27 |
version 1.2, 2009/09/27 11:51:20 |
|
|
hdl = mio_open(path, mode, 1); |
hdl = mio_open(path, mode, 1); |
if (hdl == NULL) |
if (hdl == NULL) |
return NULL; |
return NULL; |
f = (struct miofile *)file_new(ops, "miohdl", mio_nfds(hdl)); |
f = (struct miofile *)file_new(ops, "hdl", mio_nfds(hdl)); |
if (f == NULL) |
if (f == NULL) |
goto bad_close; |
goto bad_close; |
f->hdl = hdl; |
f->hdl = hdl; |
|
|
if (n == 0) { |
if (n == 0) { |
f->file.state &= ~FILE_ROK; |
f->file.state &= ~FILE_ROK; |
if (mio_eof(f->hdl)) { |
if (mio_eof(f->hdl)) { |
fprintf(stderr, "miofile_read: eof\n"); |
|
file_eof(&f->file); |
file_eof(&f->file); |
} else { |
} else { |
DPRINTFN(3, "miofile_read: %s: blocking...\n", |
|
f->file.name); |
|
} |
} |
return 0; |
return 0; |
} |
} |
|
|
if (n == 0) { |
if (n == 0) { |
f->file.state &= ~FILE_WOK; |
f->file.state &= ~FILE_WOK; |
if (mio_eof(f->hdl)) { |
if (mio_eof(f->hdl)) { |
fprintf(stderr, "miofile_write: %s: hup\n", f->file.name); |
|
file_hup(&f->file); |
file_hup(&f->file); |
} else { |
} else { |
DPRINTFN(3, "miofile_write: %s: blocking...\n", |
|
f->file.name); |
|
} |
} |
return 0; |
return 0; |
} |
} |