mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
resolve abs path in root dir, wip
This commit is contained in:
parent
43cde3609a
commit
b3c5a431d0
@ -63,7 +63,11 @@ int getAbsPath(char *buf, size_t bufSize, char *fname) {
|
|||||||
// get dir path and attach file name
|
// get dir path and attach file name
|
||||||
char *dir = dirname(path);
|
char *dir = dirname(path);
|
||||||
memset(buf, 0, bufSize);
|
memset(buf, 0, bufSize);
|
||||||
sprintf(buf, "%s/%s", dir, fname);
|
if (!strcmp(dir, "/")) {
|
||||||
|
sprintf(buf, "/%s", fname);
|
||||||
|
} else {
|
||||||
|
sprintf(buf, "%s/%s", dir, fname);
|
||||||
|
}
|
||||||
LOG(logDEBUG1, ("full path for %s: %s\n", fname, buf));
|
LOG(logDEBUG1, ("full path for %s: %s\n", fname, buf));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -689,14 +693,8 @@ int deleteOldServers(char *mess, char *newServerPath, char *errorPrefix) {
|
|||||||
currentBinary[len] = '\0';
|
currentBinary[len] = '\0';
|
||||||
LOG(logDEBUG1, ("Current binary:%s\n", currentBinary));
|
LOG(logDEBUG1, ("Current binary:%s\n", currentBinary));
|
||||||
|
|
||||||
// resolve double slashes to compare
|
|
||||||
char *newBinary = newServerPath;
|
|
||||||
while (newBinary[0] == '/' && newBinary[1] == '/') {
|
|
||||||
++newBinary;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if current binary same as new server name, replaced anyway
|
// if current binary same as new server name, replaced anyway
|
||||||
if (strcmp(currentBinary, newBinary)) {
|
if (strcmp(currentBinary, newServerPath)) {
|
||||||
if (deleteFile(mess, currentBinary, errorPrefix) == FAIL) {
|
if (deleteFile(mess, currentBinary, errorPrefix) == FAIL) {
|
||||||
LOG(logWARNING,
|
LOG(logWARNING,
|
||||||
("(%s). Could not delete old servers\n", errorPrefix));
|
("(%s). Could not delete old servers\n", errorPrefix));
|
||||||
@ -708,4 +706,4 @@ int deleteOldServers(char *mess, char *newServerPath, char *errorPrefix) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,5 @@
|
|||||||
#define APIGOTTHARD 0x220328
|
#define APIGOTTHARD 0x220328
|
||||||
#define APIGOTTHARD2 0x220328
|
#define APIGOTTHARD2 0x220328
|
||||||
#define APIJUNGFRAU 0x220328
|
#define APIJUNGFRAU 0x220328
|
||||||
#define APIMYTHEN3 0x220328
|
#define APIMYTHEN3 0x220401
|
||||||
#define APIMOENCH 0x220328
|
#define APIMOENCH 0x220328
|
||||||
|
Loading…
x
Reference in New Issue
Block a user