The Samba-Bugzilla – Attachment 1340 Details for
Bug 2922
FreeBSD AIO patches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
sival_int based code
aio.c.diff (text/plain), 2.29 KB, created by
Timur Bakeyev
on 2005-07-27 17:23:38 UTC
(
hide
)
Description:
sival_int based code
Filename:
MIME Type:
Creator:
Timur Bakeyev
Created:
2005-07-27 17:23:38 UTC
Size:
2.29 KB
patch
obsolete
>--- aio.c.orig Thu Jul 28 01:14:47 2005 >+++ aio.c Thu Jul 28 01:18:43 2005 >@@ -25,7 +25,17 @@ > > /* The signal we'll use to signify aio done. */ > #ifndef RT_SIGNAL_AIO >-#define RT_SIGNAL_AIO (SIGRTMIN+3) >+#ifndef SIGRTMIN >+#define SIGRTMIN NSIG >+#endif >+#define RT_SIGNAL_AIO (SIGRTMIN+3) >+#endif >+ >+#ifndef HAVE_STRUCT_SIGEVENT_SIGEV_VALUE_SIVAL_PTR >+#ifdef HAVE_STRUCT_SIGEVENT_SIGEV_VALUE_SIGVAL_PTR >+#define sival_int sigval_int >+#define sival_ptr sigval_ptr >+#endif > #endif > > /**************************************************************************** >@@ -155,7 +165,7 @@ > static void signal_handler(int sig, siginfo_t *info, void *unused) > { > if (signals_received < AIO_PENDING_SIZE - 1) { >- aio_pending_array[signals_received] = *(uint16 *)(info->si_value.sival_ptr); >+ aio_pending_array[signals_received] = info->si_value.sival_int; > signals_received++; > } /* Else signal is lost. */ > sys_select_signal(RT_SIGNAL_AIO); >@@ -248,7 +258,7 @@ > a->aio_offset = startpos; > a->aio_sigevent.sigev_notify = SIGEV_SIGNAL; > a->aio_sigevent.sigev_signo = RT_SIGNAL_AIO; >- a->aio_sigevent.sigev_value.sival_ptr = (void *)&aio_ex->mid; >+ a->aio_sigevent.sigev_value.sival_int = aio_ex->mid; > > if (SMB_VFS_AIO_READ(fsp,a) == -1) { > DEBUG(0,("schedule_aio_read_and_X: aio_read failed. Error %s\n", >@@ -327,7 +337,7 @@ > a->aio_offset = startpos; > a->aio_sigevent.sigev_notify = SIGEV_SIGNAL; > a->aio_sigevent.sigev_signo = RT_SIGNAL_AIO; >- a->aio_sigevent.sigev_value.sival_ptr = (void *)&aio_ex->mid; >+ a->aio_sigevent.sigev_value.sival_int = aio_ex->mid; > > if (SMB_VFS_AIO_WRITE(fsp,a) == -1) { > DEBUG(3,("schedule_aio_wrote_and_X: aio_write failed. Error %s\n", >@@ -499,6 +509,11 @@ > static BOOL handle_aio_completed(struct aio_extra *aio_ex, int *perr) > { > int err; >+ >+ if(!aio_ex) { >+ DEBUG(3, ("handle_aio_completed: Non-existing aio_ex passed\n")); >+ return False; >+ } > > /* Ensure the operation has really completed. */ > if (SMB_VFS_AIO_ERROR(aio_ex->fsp, &aio_ex->acb) == EINPROGRESS) { >@@ -644,7 +659,7 @@ > > /* One or more events might have completed - process them if so. */ > for( i = 0; i < aio_completion_count; i++) { >- uint16 mid = *(uint16 *)aiocb_list[i]->aio_sigevent.sigev_value.sival_ptr; >+ uint16 mid = aiocb_list[i]->aio_sigevent.sigev_value.sival_int; > > aio_ex = find_aio_ex(mid); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 2922
:
1338
|
1339
| 1340 |
1536