From: Derrick Brashear Date: Wed, 3 Oct 2012 14:32:34 +0000 (-0400) Subject: afsd: consolidate macos event handling code X-Git-Tag: upstream/1.8.0_pre1^2~1938 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8a9f4244dced5cacbf0daca4060fb9e0625f4a2e;p=packages%2Fo%2Fopenafs.git afsd: consolidate macos event handling code in order that this can potentially be extracted entirely to a platform-specific file, (and possibly dbus-equivalents inserted also) consolidate the macos system events handling code Change-Id: I8fc4a96dc2590778a13f27610b383ee35626871e Reviewed-on: http://gerrit.openafs.org/8201 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 817d98c8e..4c9ca729b 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -144,22 +144,10 @@ #endif #include -#include -#include - +static int event_pid; #ifndef AFS_ARM_DARWIN_ENV -#include -#include - -static io_connect_t root_port; -static IONotificationPortRef notify; -static io_object_t iterator; +#define MACOS_EVENT_HANDLING 1 #endif - -static CFRunLoopSourceRef source; - -static int event_pid; - #endif /* AFS_DARWIN_ENV */ #if AFS_HAVE_STATVFS || defined(HAVE_SYS_STATVFS_H) @@ -357,7 +345,18 @@ enum optionsList { OPT_rxmaxfrags, }; -#if defined(AFS_DARWIN_ENV) && !defined(AFS_ARM_DARWIN_ENV) +#ifdef MACOS_EVENT_HANDLING +#include +#include + +#include +#include + +static io_connect_t root_port; +static IONotificationPortRef notify; +static io_object_t iterator; +static CFRunLoopSourceRef source; + static void afsd_sleep_callback(void * refCon, io_service_t service, natural_t messageType, void * messageArgument ) @@ -1467,7 +1466,7 @@ AfsdbLookupHandler(void) kernelMsg[1] = 0; acellName[0] = '\0'; -#if defined(AFS_DARWIN_ENV) && !defined(AFS_ARM_DARWIN_ENV) +#ifdef MACOS_EVENT_HANDLING /* Fork the event handler also. */ code = fork(); if (code == 0) {