diff options
author | onefang | 2021-08-10 17:27:16 +1000 |
---|---|---|
committer | onefang | 2021-08-10 17:27:16 +1000 |
commit | 0813a911a58763a2473eab402ce1c8d3a2658fe0 (patch) | |
tree | fb0d25177f94732d8b041bd2ef4abad1ec868d6f | |
parent | UPdate the help text, and related comments. (diff) | |
download | opensim-SC-0813a911a58763a2473eab402ce1c8d3a2658fe0.zip opensim-SC-0813a911a58763a2473eab402ce1c8d3a2658fe0.tar.gz opensim-SC-0813a911a58763a2473eab402ce1c8d3a2658fe0.tar.bz2 opensim-SC-0813a911a58763a2473eab402ce1c8d3a2658fe0.tar.xz |
Cleanly symlink the executable by removing it if it exists already.
-rw-r--r-- | src/sledjchisl/sledjchisl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 405da6a..ca2927e 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c | |||
@@ -7700,6 +7700,12 @@ jit library is loaded or the JIT compiler will not be activated. | |||
7700 | char *newPath = xmprintf("%s/current/bin/sledjchisl", scRoot); | 7700 | char *newPath = xmprintf("%s/current/bin/sledjchisl", scRoot); |
7701 | tmp = xmprintf("%s/sledjchisl", scBin); | 7701 | tmp = xmprintf("%s/sledjchisl", scBin); |
7702 | I("Symlinking %s to %s", newPath, tmp); | 7702 | I("Symlinking %s to %s", newPath, tmp); |
7703 | if (qfile_exist(tmp)) | ||
7704 | { | ||
7705 | snprintf(toybuf, sizeof(toybuf), "rm %s", tmp); | ||
7706 | if (!WIFEXITED(system(toybuf))) | ||
7707 | E("rm command failed!"); | ||
7708 | } | ||
7703 | if (0 != symlink(newPath, tmp)) | 7709 | if (0 != symlink(newPath, tmp)) |
7704 | perror_msg("Symlinking %s to %s", newPath, tmp); | 7710 | perror_msg("Symlinking %s to %s", newPath, tmp); |
7705 | free(tmp); | 7711 | free(tmp); |