From af415156080a979b30375f11482465e6cf7a1d91 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 24 Mar 2010 14:49:11 -0400 Subject: [PATCH] growl agent should handle port busy if the port can't be bound, die cleanly. FIXES 126812 Change-Id: I6523f18c2b5f5bacfbd11d08736b9af14fa666e2 Reviewed-on: http://gerrit.openafs.org/1651 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/platform/DARWIN/growlagent/main.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/platform/DARWIN/growlagent/main.m b/src/platform/DARWIN/growlagent/main.m index 1d256da21a..2982d02809 100644 --- a/src/platform/DARWIN/growlagent/main.m +++ b/src/platform/DARWIN/growlagent/main.m @@ -223,10 +223,16 @@ int main(int argc, const char **argv) { CFSocketContext MarinerSocketContext = {0, (void *)&growlContext, NULL, NULL, NULL }; CFSocketRef MarinerSocket = CFSocketCreateWithSocketSignature(kCFAllocatorDefault, &MarinerSignature, kCFSocketReadCallBack, &MySocketReadCallBack, &MarinerSocketContext); + + if (!MarinerSocket) + goto fail; CFSocketSetSocketFlags(MarinerSocket, kCFSocketCloseOnInvalidate|kCFSocketAutomaticallyReenableReadCallBack); CFRunLoopSourceRef MarinerRunLoopSource = CFSocketCreateRunLoopSource(NULL, MarinerSocket, 0); + if (!MarinerRunLoopSource) + goto fail; + CFRunLoopAddSource(CFRunLoopGetCurrent(), MarinerRunLoopSource, kCFRunLoopCommonModes); /* Run the run loop until it is manually cancelled */ @@ -236,6 +242,7 @@ int main(int argc, const char **argv) { CFRelease(MarinerRunLoopSource); CFSocketInvalidate(MarinerSocket); CFRelease(MarinerSocket); +fail: /* CFRelease(notificationInfo); */ [pool release];