diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-01-07 16:37:36 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-01-07 16:37:36 -0800 |
| commit | 60731e6d02c4ebeb0700bc1c6a53261159049e01 (patch) | |
| tree | 6cffdd1139cc0ecc25e9fc62ac794e9091b3d4c3 /main.cpp | |
| parent | c1256fff5b0c09359531fc09bc8235c6f11c800d (diff) | |
| download | infinitytier-60731e6d02c4ebeb0700bc1c6a53261159049e01.tar.gz infinitytier-60731e6d02c4ebeb0700bc1c6a53261159049e01.zip | |
Update URLs for auto-update, check supernode version in one more place, delete pid before executing updater.
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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; |
