From ed79b2a85ab4e948c03ad2d7222008715fe369d4 Mon Sep 17 00:00:00 2001
From: X512 <danger_mail@list.ru>
Date: Mon, 25 May 2020 01:00:39 +0900
Subject: jam: use load_image on Haiku
---
jam/execunix.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/jam/execunix.c b/jam/execunix.c
index eba2aba27d..005146b925 100644
a
|
b
|
|
54 | 54 | # define USE_POSIX_SPAWN |
55 | 55 | # endif |
56 | 56 | |
| 57 | # ifdef __HAIKU__ |
| 58 | # define USE_LOAD_IMAGE |
| 59 | # endif |
| 60 | |
57 | 61 | # ifdef unix |
58 | 62 | # include <unistd.h> |
59 | 63 | |
… |
… |
extern char **environ;
|
62 | 66 | # include <spawn.h> |
63 | 67 | # endif |
64 | 68 | |
| 69 | # ifdef USE_LOAD_IMAGE |
| 70 | # include <OS.h> |
| 71 | # include <image.h> |
| 72 | # endif |
| 73 | |
65 | 74 | # endif |
66 | 75 | |
67 | 76 | # ifdef OS_NT |
… |
… |
execcmd(
|
243 | 252 | exit( EXITBAD ); |
244 | 253 | } |
245 | 254 | # else |
| 255 | # ifdef USE_LOAD_IMAGE |
| 256 | int argc = 0; |
| 257 | while (argv[argc] != NULL) argc++; |
| 258 | if ((pid = load_image(argc, argv, (const char**)environ)) < B_OK) { |
| 259 | perror( "load_image" ); |
| 260 | exit( EXITBAD ); |
| 261 | } |
| 262 | resume_thread(pid); |
| 263 | # else |
246 | 264 | # ifdef NO_VFORK |
247 | 265 | if ((pid = fork()) == 0) |
248 | 266 | { |
… |
… |
execcmd(
|
263 | 281 | exit( EXITBAD ); |
264 | 282 | } |
265 | 283 | # endif |
| 284 | # endif |
266 | 285 | # endif |
267 | 286 | /* Save the operation for execwait() to find. */ |
268 | 287 | |