From: <haw...@us...> - 2008-10-30 14:59:46
|
Revision: 207 http://pgsqlformac.svn.sourceforge.net/pgsqlformac/?rev=207&view=rev Author: hawkmoon Date: 2008-10-30 14:59:39 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Resolved Bug: #1956172 - read buffer was too small and when paired with how NSLog() was being used caused strange output into the console. Modified Paths: -------------- trunk/ServiceManager/SQLServiceManager.m Modified: trunk/ServiceManager/SQLServiceManager.m =================================================================== --- trunk/ServiceManager/SQLServiceManager.m 2008-10-30 14:37:59 UTC (rev 206) +++ trunk/ServiceManager/SQLServiceManager.m 2008-10-30 14:59:39 UTC (rev 207) @@ -216,7 +216,7 @@ do { - AuthorizationItem myItems = {kAuthorizationRightExecute, [pathToHelper length], [pathToHelper cString], 0}; + AuthorizationItem myItems = {kAuthorizationRightExecute, [pathToHelper length], (char *)[pathToHelper cString], 0}; AuthorizationRights myRights = {1, &myItems}; myFlags = kAuthorizationFlagDefaults | @@ -231,13 +231,12 @@ const char *myToolPath = [pathToHelper cString]; char *myArguments[4]; - myArguments[0] = [command cString]; - myArguments[1] = [operation cString]; + myArguments[0] = (char *)[command cString]; + myArguments[1] = (char *)[operation cString]; myArguments[2] = "MANUAL"; myArguments[3] = NULL; FILE *myCommunicationsPipe = NULL; - char myReadBuffer[128]; myFlags = kAuthorizationFlagDefaults; myStatus = AuthorizationExecuteWithPrivileges(myAuthorizationRef, @@ -246,8 +245,10 @@ if (myStatus == errAuthorizationSuccess) for(;;) { - int bytesRead = read (fileno (myCommunicationsPipe), - myReadBuffer, sizeof (myReadBuffer)); + char myReadBuffer[1024]; + + int bytesRead = read(fileno(myCommunicationsPipe), + myReadBuffer, sizeof(myReadBuffer)); if (bytesRead < 1) break; NSLog(@"%s", myReadBuffer); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |