diff options
| author | Michael Brown | 2007-01-16 09:10:54 +0100 |
|---|---|---|
| committer | Michael Brown | 2007-01-16 09:10:54 +0100 |
| commit | ff8528ea9a69ca2ef6cfbed0b7a1283e165aabe6 (patch) | |
| tree | bae0e953c128a5d49bedd2f502325b938078635f /src/usr/fetch.c | |
| parent | When a network device is specified to tcpip_tx() or it's children, treat (diff) | |
| download | ipxe-ff8528ea9a69ca2ef6cfbed0b7a1283e165aabe6.tar.gz ipxe-ff8528ea9a69ca2ef6cfbed0b7a1283e165aabe6.tar.xz ipxe-ff8528ea9a69ca2ef6cfbed0b7a1283e165aabe6.zip | |
Create and use async_block() macro; it cuts down on the visual overhead
of blocking on asynchronous operations, when that isn't an important
aspect of the code.
Diffstat (limited to 'src/usr/fetch.c')
| -rw-r--r-- | src/usr/fetch.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/usr/fetch.c b/src/usr/fetch.c index 45031049c..11197e9fd 100644 --- a/src/usr/fetch.c +++ b/src/usr/fetch.c @@ -86,11 +86,8 @@ int fetch ( const char *uri_string, userptr_t *data, size_t *len ) { } } - async_init_orphan ( &async ); - if ( ( rc = download ( uri, &buffer, &async ) ) != 0 ) - goto err; - async_wait ( &async, &rc, 1 ); - if ( rc != 0 ) + if ( ( rc = async_block ( &async, + download ( uri, &buffer, &async ) ) ) != 0 ) goto err; /* Fill in buffer address and length */ |
