*** empty log message ***

svn path=/trunk/boinc/; revision=6802
This commit is contained in:
Charlie Fenton 2005-07-26 02:40:47 +00:00
parent 72eec32ce3
commit c45d4bf9e6
7 changed files with 44 additions and 18 deletions

View File

@ -9550,3 +9550,10 @@ David 25 July 2005
client/
cs_scheduler.C
Charlie 25 July 2005
- Mac installer: specifically quit core client if running in addition
to quitting BOINC Manager, since cc may be running without manager.
mac_installer/
PostInstall.cpp

View File

@ -1,5 +1,5 @@
/* Localized versions of Info.plist keys */
CFBundleName = "BOINC";
CFBundleShortVersionString = "BOINC version 4.71";
CFBundleGetInfoString = "BOINC version 4.71, Copyright 2005 University of California.";
CFBundleShortVersionString = "BOINC version 4.72";
CFBundleGetInfoString = "BOINC version 4.72, Copyright 2005 University of California.";

View File

@ -17,6 +17,6 @@
<key>CFBundleSignature</key>
<string>BNC!</string>
<key>CFBundleVersion</key>
<string>4.71</string>
<string>4.72</string>
</dict>
</plist>

View File

@ -15,6 +15,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.71</string>
<string>4.72</string>
</dict>
</plist>

View File

@ -17,7 +17,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.71</string>
<string>4.72</string>
<key>NSPrincipalClass</key>
<string>BOINC_Saver_ModuleView</string>
</dict>

View File

@ -15,6 +15,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.71</string>
<string>4.72</string>
</dict>
</plist>

View File

@ -34,7 +34,7 @@
void Initialize(void); /* function prototypes */
void SetUIDBackToUser (void);
OSErr FindProcess (OSType typeToFind, OSType creatorToFind, ProcessSerialNumberPtr processSN);
pid_t FindProcessPID(pid_t thePID);
pid_t FindProcessPID(char* name, pid_t thePID);
static OSErr QuitBOINCManager(OSType signature);
static OSErr QuitAppleEventHandler(const AppleEvent *appleEvt, AppleEvent* reply, UInt32 refcon);
void print_to_log_file(const char *format, ...);
@ -52,7 +52,7 @@ int main(int argc, char *argv[])
group *grp;
char s[256];
int NumberOfLoginItems, Counter, i;
pid_t installerPID = 0;
pid_t installerPID = 0, coreClientPID = 0;
FSRef fileRef;
OSStatus err;
@ -60,8 +60,13 @@ int main(int argc, char *argv[])
::GetCurrentProcess (&ourProcess);
QuitBOINCManager('BNC!'); // Quit any old instance of BOINC
QuitBOINCManager('BNC!'); // Quit any old instance of BOINC manager
sleep(2);
// Core Client may still be running if it was started without Manager
coreClientPID = FindProcessPID("boinc", 0);
if (coreClientPID)
kill(coreClientPID, SIGTERM); // boinc catches SIGTERM & exits gracefully
err = FindProcess ('APPL', 'xins', &installerPSN);
if (err == noErr)
err = GetProcessPID(&installerPSN , &installerPID);
@ -160,7 +165,7 @@ int main(int argc, char *argv[])
for (i=0; i<15; i++) { // Wait 15 seconds max for installer to quit
sleep (1);
if (FindProcessPID(installerPID) == 0)
if (FindProcessPID(NULL, installerPID) == 0)
break;
}
@ -228,21 +233,35 @@ OSErr FindProcess (OSType typeToFind, OSType creatorToFind, ProcessSerialNumberP
}
pid_t FindProcessPID(pid_t thePID)
pid_t FindProcessPID(char* name, pid_t thePID)
{
FILE *f;
char buf[1024];
size_t n = 0;
pid_t aPID;
if (name != NULL) // Search ny name
n = strlen(name);
f = popen("ps -a -x -c -o command,pid", "r");
if (f == NULL)
return 0;
while (fgets(buf, sizeof(buf), f)) {
aPID = atol(buf+16);
if (aPID == thePID) {
pclose(f);
return aPID;
while (fgets(buf, sizeof(buf), f))
{
if (name != NULL) { // Search ny name
if (strncmp(buf, name, n) == 0)
{
aPID = atol(buf+16);
pclose(f);
return aPID;
}
} else { // Search by PID
aPID = atol(buf+16);
if (aPID == thePID) {
pclose(f);
return aPID;
}
}
}
pclose(f);