Skip to content

Commit

Permalink
build: improve tmpdir management (#15)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
thebaptiste and mergify[bot] committed Jan 1, 2021
1 parent 205f66b commit 6a1dd31
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/mapserverapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@ void mapserverapi_init() {
if (tmp != NULL) {
__MAPSERVERAPI_TMPDIR = g_strdup(tmp);
}
tmp = g_getenv("TMPDIR");
if (tmp != NULL) {
__MAPSERVERAPI_TMPDIR = g_strdup(tmp);
}
tmp = g_getenv("TMP");
if (tmp != NULL) {
__MAPSERVERAPI_TMPDIR = g_strdup(tmp);
else {
tmp = g_getenv("TMPDIR");
if (tmp != NULL) {
__MAPSERVERAPI_TMPDIR = g_strdup(tmp);
}
else {
tmp = g_getenv("TMP");
if (tmp != NULL) {
__MAPSERVERAPI_TMPDIR = g_strdup(tmp);
}
else {
__MAPSERVERAPI_TMPDIR = g_strdup("/tmp");
}
}
}
__MAPSERVERAPI_TMPDIR = g_strdup("/tmp");
if (__MAPSERVER_SETUP == FALSE) {
msSetup();
__MAPSERVER_SETUP = TRUE;
Expand Down

0 comments on commit 6a1dd31

Please sign in to comment.