diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-01-05 11:18:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:55 -0500 |
commit | f933a9abc2ea9d2dc417b9ba500bbe730be3c1aa (patch) | |
tree | c191f71d8231cb3ebb587031b6a23e7713f492b5 | |
parent | f3a85fb152c0cb07ae1c096f06488f88c4c9d741 (diff) | |
download | samba-f933a9abc2ea9d2dc417b9ba500bbe730be3c1aa.tar.gz samba-f933a9abc2ea9d2dc417b9ba500bbe730be3c1aa.tar.bz2 samba-f933a9abc2ea9d2dc417b9ba500bbe730be3c1aa.zip |
r20541: Fix some obvious glitches in wait_for_aio_completion. Hmmm. It seems
reply_close() at its heart is going to be an async call :-)
Volker
(This used to be commit 36f60407ae9b430dc5d7f67dd3e7ed8b1dbc93a8)
-rw-r--r-- | source3/smbd/aio.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c index ad25242060..0abc20ab7d 100644 --- a/source3/smbd/aio.c +++ b/source3/smbd/aio.c @@ -580,14 +580,13 @@ int process_aio_queue(void) #define SMB_TIME_FOR_AIO_COMPLETE_WAIT 29 -BOOL wait_for_aio_completion(files_struct *fsp) +int wait_for_aio_completion(files_struct *fsp) { struct aio_extra *aio_ex; const SMB_STRUCT_AIOCB **aiocb_list; int aio_completion_count = 0; time_t start_time = time(NULL); int seconds_left; - int ret = 0; for (seconds_left = SMB_TIME_FOR_AIO_COMPLETE_WAIT; seconds_left >= 0;) { int err = 0; @@ -602,7 +601,7 @@ BOOL wait_for_aio_completion(files_struct *fsp) } if (!aio_completion_count) { - return ret; + return 0; } DEBUG(3,("wait_for_aio_completion: waiting for %d aio events to complete.\n", @@ -610,7 +609,7 @@ BOOL wait_for_aio_completion(files_struct *fsp) aiocb_list = SMB_MALLOC_ARRAY(const SMB_STRUCT_AIOCB *, aio_completion_count); if (!aiocb_list) { - return False; + return ENOMEM; } for( i = 0, aio_ex = aio_list_head; aio_ex; aio_ex = aio_ex->next) { @@ -637,7 +636,7 @@ BOOL wait_for_aio_completion(files_struct *fsp) /* Timeout. */ cancel_aio_by_fsp(fsp); SAFE_FREE(aiocb_list); - return ret ? ret : EIO; + return EIO; } /* One or more events might have completed - process them if so. */ @@ -666,7 +665,7 @@ BOOL wait_for_aio_completion(files_struct *fsp) DEBUG(10,("wait_for_aio_completion: aio_suspend timed out waiting for %d events\n", aio_completion_count)); - return ret ? ret : EIO; + return EIO; } /**************************************************************************** |