Ticket #16106: 0001-jam-use-load_image-on-Haiku.patch

File 0001-jam-use-load_image-on-Haiku.patch, 1.2 KB (added by X512, 4 years ago)

Jam patch.

  • jam/execunix.c

    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  
    5454# define USE_POSIX_SPAWN
    5555# endif
    5656
     57# ifdef __HAIKU__
     58# define USE_LOAD_IMAGE
     59# endif
     60
    5761# ifdef unix
    5862# include <unistd.h>
    5963
    extern char **environ;  
    6266# include <spawn.h>
    6367# endif
    6468
     69# ifdef USE_LOAD_IMAGE
     70# include <OS.h>
     71# include <image.h>
     72# endif
     73
    6574# endif
    6675
    6776# ifdef OS_NT
    execcmd(  
    243252        exit( EXITBAD );
    244253    }
    245254# 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
    246264# ifdef NO_VFORK
    247265    if ((pid = fork()) == 0)
    248266    {
    execcmd(  
    263281        exit( EXITBAD );
    264282    }
    265283# endif
     284# endif
    266285# endif
    267286    /* Save the operation for execwait() to find. */
    268287