aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-11-25 10:36:15 +0000
committerdos-reis <gdr@axiomatics.org>2013-11-25 10:36:15 +0000
commitcfd056bea1da3fb8c166a615ee3a97a831491469 (patch)
tree24c8e4d579319f9dc31ce109adc1f2b89df34f90 /src/lib
parent0bed25f5cc01f43f6190174c29cdbd5a8bd7aff4 (diff)
downloadopen-axiom-cfd056bea1da3fb8c166a615ee3a97a831491469.tar.gz
Fix rotten Windows port.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cfuns-c.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c
index cac76b6c..c5d5c870 100644
--- a/src/lib/cfuns-c.c
+++ b/src/lib/cfuns-c.c
@@ -492,8 +492,9 @@ oa_acquire_temporary_pathname() {
#if OPENAXIOM_MS_WINDOWS_HOST
char buf[MAX_PATH];
const char* tmpdir = oa_get_tmpdir();
- auto n = GetTempFileName(tmpdir, "oa-", rand() % SHORT_MAX, buf);
- free(tmpdir);
+ auto n = GetTempFileName(tmpdir, "oa-", rand() % SHRT_MAX, buf);
+ /* tmpdir was malloc()ed when OPENAXIOM_MS_WINDOWS_HOST. */
+ free(const_cast<void*>(tmpdir));
if (n == 0) {
perror("oa_acquire_temporary_pathname");
exit(1);
@@ -816,7 +817,7 @@ oa_spawn(Process* proc, SpawnFlags flags)
}
cmd_line[curpos] = '\0';
- if ((flags & spawn_search_path) == 0)
+ if ((flags & SpawnFlags::search_path) == 0)
path = proc->argv[0];
if(CreateProcess(/* lpApplicationName */ path,
@@ -833,7 +834,7 @@ oa_spawn(Process* proc, SpawnFlags flags)
return proc->id = -1;
}
proc->id = proc_info.dwProcessId;
- if ((flags & spawn_replace) == 0)
+ if ((flags & SpawnFlags::replace) == 0)
return proc->id;
WaitForSingleObject(proc_info.hProcess, INFINITE);
GetExitCodeProcess(proc_info.hProcess, &status);