summaryrefslogtreecommitdiffstats
path: root/src/core/posix_io.c
diff options
context:
space:
mode:
authorMichael Brown2007-05-26 17:04:36 +0200
committerMichael Brown2007-05-26 17:04:36 +0200
commit10d0a1f8c759309ad0aa8f73c87ae7b45cbb5fe6 (patch)
tree626d6b2493ebf72ef02ae7bae5f7bc77de8d7092 /src/core/posix_io.c
parentModify process semantics; rescheduling is now automatic. (diff)
downloadipxe-10d0a1f8c759309ad0aa8f73c87ae7b45cbb5fe6.tar.gz
ipxe-10d0a1f8c759309ad0aa8f73c87ae7b45cbb5fe6.tar.xz
ipxe-10d0a1f8c759309ad0aa8f73c87ae7b45cbb5fe6.zip
Modify data-xfer semantics: it is no longer necessary to call one of
request(), seek() or deliver_xxx() in order to start the data flow. Autonomous generators must be genuinely autonomous (having their own process), or otherwise arrange to be called. TCP does this by starting the retry timer immediately. Add some debugging statements.
Diffstat (limited to 'src/core/posix_io.c')
-rw-r--r--src/core/posix_io.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/posix_io.c b/src/core/posix_io.c
index 6cefbf7b..3b5660e4 100644
--- a/src/core/posix_io.c
+++ b/src/core/posix_io.c
@@ -191,6 +191,7 @@ static int posix_find_free_fd ( void ) {
if ( ! posix_fd_to_file ( fd ) )
return fd;
}
+ DBG ( "POSIX could not find free file descriptor\n" );
return -ENFILE;
}
@@ -226,13 +227,11 @@ int open ( const char *uri_string ) {
if ( ( rc = xfer_open_uri ( &file->xfer, uri_string ) ) != 0 )
goto err;
- /* Request data */
- if ( ( rc = xfer_request_all ( &file->xfer ) ) != 0 )
- goto err;
-
/* Wait for open to succeed or fail */
while ( list_empty ( &file->data ) ) {
step();
+ if ( file->rc == 0 )
+ break;
if ( file->rc != -EINPROGRESS ) {
rc = file->rc;
goto err;
@@ -241,6 +240,7 @@ int open ( const char *uri_string ) {
/* Add to list of open files. List takes reference ownership. */
list_add ( &file->list, &posix_files );
+ DBG ( "POSIX opened %s as file %d\n", uri_string, fd );
return fd;
err: