@@ -118,17 +118,14 @@ get_arg_string_length(char *const argv[]) {
118118    return  (result );
119119}
120120int 
121- spawnvpe_callback (
121+ spawnvpe (
122122    const  char  * file ,
123123    const  char  * * argv ,
124124    char  * * deltaenv ,
125125    const  char  * cwd ,
126126    int  fhin ,
127127    int  fhout ,
128-     int  fherr ,
129- 
130-     void  (* entry_fp )(void  * ), void *  entry_data ,
131-     void  (* final_fp )(int , void  * ), void *  final_data 
128+     int  fherr 
132129) {
133130    int  ret  =  -1 ;
134131    struct  name_translation_info  nti_name ;
@@ -144,10 +141,12 @@ spawnvpe_callback(
144141    size_t  parameter_string_len  =  0 ;
145142    struct  _clib4  * __clib4  =  __CLIB4 ;
146143    struct  Task  * me  =  (struct  Task  * ) __clib4 -> self ;
144+     BPTR  seglist ;
147145
148146    __set_errno (0 );
149147
150148    D (("Starting new process [%s]\n" , name ));
149+     // printf("[spawnvpe :] Starting new process [%s]\n", name); 
151150
152151    int  error  =  __translate_unix_to_amiga_path_name (& name , & nti_name );
153152    if  (error ) {
@@ -158,6 +157,12 @@ spawnvpe_callback(
158157
159158    D (("name after conversion: [%s]\n" , name ));
160159
160+ #if  0 
161+     seglist  =  LoadSeg (name );
162+ 	if  (!seglist )
163+ 		return  -1 ;
164+ #endif 
165+ 
161166    BPTR  fileLock  =  Lock (name , SHARED_LOCK );
162167    if  (fileLock ) {
163168        progdirLock  =  ParentDir (fileLock );
@@ -200,6 +205,8 @@ spawnvpe_callback(
200205
201206    D (("File to execute: [%s]\n" , finalpath ));
202207
208+     // printf("[spawnvpe :] full command == <%s>\n", finalpath); 
209+ 
203210    if  (fhin  >= 0 ) {
204211        err  =  __get_default_file (fhin , & fh );
205212        if  (err ) {
@@ -244,7 +251,51 @@ spawnvpe_callback(
244251
245252    D (("(*)Calling SystemTags.\n" ));
246253
254+     // struct EntryData ed; 
255+ 
247256    struct  Task  * _me  =  FindTask (0 );
257+ #if  0 
258+   struct  Process  * p  =  CreateNewProcTags (
259+     NP_Seglist ,		seglist ,
260+     NP_FreeSeglist ,	TRUE,
261+ 
262+     NP_Cli ,			TRUE,
263+     NP_Child ,		TRUE,
264+     NP_NotifyOnDeathSigTask , _me ,
265+ 
266+ #if  1 
267+     NP_Input ,		iofh [0 ],
268+     NP_CloseInput ,	closefh [0 ],
269+     NP_Output ,		iofh [1 ],
270+     NP_CloseOutput ,	closefh [1 ],
271+     NP_Error ,		iofh [2 ],
272+     NP_CloseError ,	closefh [2 ],
273+ #else 
274+     NP_Input ,		IDOS -> Input (),
275+     NP_CloseInput ,	FALSE,
276+     NP_Output ,		IDOS -> Output (),
277+     NP_CloseOutput ,	FALSE,
278+     NP_Error ,		IDOS -> ErrorOutput (),
279+     NP_CloseError ,	FALSE,
280+ #endif 
281+ 
282+     NP_EntryCode , spawnvpe_entryCode ,
283+     NP_EntryData , & ed ,
284+ 
285+     // NP_FinalCode,	amiga_FinalCode, 
286+     // NP_FinalData,	fd, 
287+ 
288+     // NP_EntryCode,  spawnedProcessEnter, 
289+     NP_ExitCode ,   spawnedProcessExit ,
290+ 
291+     NP_Name ,      strdup (processName ),
292+     cwdLock  ? NP_CurrentDir  : TAG_SKIP , cwdLock ,
293+     progdirLock  ? NP_ProgramDir  : TAG_SKIP , progdirLock ,
294+     NP_Arguments , arg_string ,
295+     TAG_DONE 
296+   );
297+   if  (p ) ret  =  0 ;
298+ #else 
248299    ret  =  SystemTags (finalpath ,
249300                     NP_NotifyOnDeathSigTask , _me ,
250301                     SYS_Input , iofh [0 ],
@@ -256,12 +307,12 @@ spawnvpe_callback(
256307                     progdirLock  ? NP_ProgramDir  : TAG_SKIP , progdirLock ,
257308                     cwdLock  ? NP_CurrentDir  : TAG_SKIP , cwdLock ,
258309                     NP_Name , strdup (processName ),
259-                      entry_fp  ? NP_EntryCode     : TAG_SKIP ,	entry_fp ,
260-                      entry_data  ? NP_EntryData   : TAG_SKIP , entry_data ,
261-                      final_fp  ? NP_FinalCode     : TAG_SKIP ,	final_fp ,
262-                      final_data  ? NP_FinalData   : TAG_SKIP , final_data ,
263-                      NP_ExitCode , spawnedProcessExit ,
310+ 
311+                      NP_EntryCode ,  spawnedProcessEnter ,
312+                      NP_ExitCode ,   spawnedProcessExit ,
313+ 
264314                     TAG_DONE );
315+ #endif 
265316
266317    D (("SystemTags completed. return value: [%ld]\n" , ret ));
267318
@@ -280,16 +331,6 @@ spawnvpe_callback(
280331         * just after SystemTags. In this case spawnv will return pid 
281332         */ 
282333        ret  =  IoErr ();
283-         if  (insertSpawnedChildren (ret , getgid ())) {
284-             D (("Children with pid %ld and gid %ld inserted into list\n" , ret , getgid ()));
285-         }
286-         else  {
287-             D (("Cannot insert children with pid %ld and gid %ld into list\n" , ret , getgid ()));
288-         }
289334    }
290- 
291335    return  ret ;
292336}
293- int  spawnvpe (const  char  * file , const  char  * * argv , char  * * deltaenv , const  char  * dir , int  fhin , int  fhout , int  fherr ) {
294-     return  spawnvpe_callback (file , argv , deltaenv , dir , fhin , fhout , fherr , 0 , 0 , 0 , 0 );
295- }
0 commit comments