summaryrefslogtreecommitdiff
path: root/source3/smbd/aio.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-07-18 20:04:42 -0400
committerSimo Sorce <idra@samba.org>2010-07-18 20:04:42 -0400
commit7e4de49bfceed18c81abf93703a61d0a22617a24 (patch)
tree37b74b75d0edcfe28ce4d9898c0889a74b262492 /source3/smbd/aio.c
parent378e4d5b8d30733f0f28cc2bceb28d9b9b594707 (diff)
parent27aece72004a84a6e0b2e00987d8a362e307d1d8 (diff)
downloadsamba-7e4de49bfceed18c81abf93703a61d0a22617a24.tar.gz
samba-7e4de49bfceed18c81abf93703a61d0a22617a24.tar.bz2
samba-7e4de49bfceed18c81abf93703a61d0a22617a24.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/smbd/aio.c')
-rw-r--r--source3/smbd/aio.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index a5a0e44738..dbce120dc6 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -67,11 +67,17 @@ static void smbd_aio_signal_handler(struct tevent_context *ev_ctx,
}
-static void initialize_async_io_handler(void)
+static bool initialize_async_io_handler(void)
{
+ static bool tried_signal_setup = false;
+
if (aio_signal_event) {
- return;
+ return true;
+ }
+ if (tried_signal_setup) {
+ return false;
}
+ tried_signal_setup = true;
aio_signal_event = tevent_add_signal(smbd_event_context(),
smbd_event_context(),
@@ -79,7 +85,8 @@ static void initialize_async_io_handler(void)
smbd_aio_signal_handler,
NULL);
if (!aio_signal_event) {
- exit_server("Failed to setup RT_SIGNAL_AIO handler");
+ DEBUG(10, ("Failed to setup RT_SIGNAL_AIO handler\n"));
+ return false;
}
/* tevent supports 100 signal with SA_SIGINFO */
@@ -145,7 +152,9 @@ NTSTATUS schedule_aio_read_and_X(connection_struct *conn,
int ret;
/* Ensure aio is initialized. */
- initialize_async_io_handler();
+ if (!initialize_async_io_handler()) {
+ return NT_STATUS_RETRY;
+ }
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
@@ -250,7 +259,9 @@ NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
int ret;
/* Ensure aio is initialized. */
- initialize_async_io_handler();
+ if (!initialize_async_io_handler()) {
+ return NT_STATUS_RETRY;
+ }
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
@@ -382,7 +393,9 @@ NTSTATUS schedule_smb2_aio_read(connection_struct *conn,
int ret;
/* Ensure aio is initialized. */
- initialize_async_io_handler();
+ if (!initialize_async_io_handler()) {
+ return NT_STATUS_RETRY;
+ }
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */
@@ -478,7 +491,9 @@ NTSTATUS schedule_aio_smb2_write(connection_struct *conn,
int ret;
/* Ensure aio is initialized. */
- initialize_async_io_handler();
+ if (!initialize_async_io_handler()) {
+ return NT_STATUS_RETRY;
+ }
if (fsp->base_fsp != NULL) {
/* No AIO on streams yet */