Update URLs for auto-update, check supernode version in one more place, delete pid before executing updater.

This commit is contained in:
Adam Ierymenko 2014-01-07 16:37:36 -08:00
parent c1256fff5b
commit 60731e6d02
3 changed files with 17 additions and 11 deletions

View file

@ -487,8 +487,10 @@ int main(int argc,char **argv)
case Node::NODE_RESTART_FOR_UPGRADE: {
#ifdef __UNIX_LIKE__
const char *upgPath = node->reasonForTermination();
if (upgPath)
execl(upgPath,upgPath,"-s",(char *)0); // -s = (re)start after install/upgrade
if (upgPath) {
Utils::rm((std::string(homeDir)+"/zerotier-one.pid").c_str());
execl(upgPath,upgPath,(char *)0);
}
exitCode = 2;
fprintf(stderr,"%s: abnormal termination: unable to execute update at %s\n",argv[0],(upgPath) ? upgPath : "(unknown path)");
#endif
@ -506,11 +508,7 @@ int main(int argc,char **argv)
} catch ( ... ) {}
#ifdef __UNIX_LIKE__
{
char pidpath[4096];
Utils::snprintf(pidpath,sizeof(pidpath),"%s/zerotier-one.pid",homeDir);
Utils::rm(pidpath);
}
Utils::rm((std::string(homeDir)+"/zerotier-one.pid").c_str());
#endif
return exitCode;