complete path for eiger

This commit is contained in:
maliakal_d 2021-11-11 10:56:09 +01:00
parent c532ecc2e8
commit 93a191f122
2 changed files with 9 additions and 6 deletions

View File

@ -543,7 +543,6 @@ int writeBinaryFile(char *mess, char *fname, char *buffer,
LOG(logDEBUG1, LOG(logDEBUG1,
("bytesWritten:%lu filesize:%lu\n", bytesWritten, filesize)); ("bytesWritten:%lu filesize:%lu\n", bytesWritten, filesize));
} }
printf("\n");
if (fclose(fp) != 0) { if (fclose(fp) != 0) {
sprintf(mess, "Could not %s. (closing file pointer)\n", errorPrefix); sprintf(mess, "Could not %s. (closing file pointer)\n", errorPrefix);
LOG(logERROR, (mess)); LOG(logERROR, (mess));

View File

@ -9473,16 +9473,20 @@ void receive_program_default(int file_des, enum PROGRAM_INDEX index,
"update detector server"); "update detector server");
// extra step to write to temp and move to real file as // extra step to write to temp and move to real file as
// fopen will give text busy if opening same name as process name // fopen will give text busy if opening same name as process name
if (ret == OK) { char dest[MAX_STR_LENGTH] = {0};
ret = moveBinaryFile(mess, serverName, TEMP_PROG_FILE_NAME, sprintf(dest, "%s%s",
(myDetectorType == EIGER ? "/home/root/executables/" : ""),
serverName)
if (ret == OK) {
ret = moveBinaryFile(mess, dest, TEMP_PROG_FILE_NAME,
"update detector server"); "update detector server");
} }
if (ret == OK) { if (ret == OK) {
ret = verifyChecksumFromFile(mess, functionType, checksum, ret = verifyChecksumFromFile(mess, functionType, checksum, dest);
serverName);
} }
if (ret == OK) { if (ret == OK) {
ret = setupDetectorServer(mess, serverName); ret = setupDetectorServer(mess, dest);
} }
break; break;
#endif #endif