[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MiNTLib Patches



Hi,

Dirk Stadler suggested the following patch to `thread.c' in his big patch list:

> diff -u 46.orig/libsrc/thread.c 46/libsrc/thread.c
> --- 46.orig/libsrc/thread.c	Tue Mar 14 21:01:54 1995
> +++ 46/libsrc/thread.c	Fri Dec  8 15:52:35 1995
> @@ -41,7 +41,6 @@
>  })
>  #endif /* __MBASE__ */
>  
> -extern int __mint;
>  extern long _childtime;			/* in main.c */
>  extern long _sigpending, _sigmask;	/* in signal.c */
>  extern __Sigfunc _sig_handler[NSIG];	/* ditto */
> @@ -109,9 +108,7 @@
>  	b->p_bbase = (char *) mbasep();
>  #endif /* __MBASE__ */
>   
> -	if (__mint)
> -		pid = Pexec(104, 0L, b, 0L);
> -	else {
> +	if ((pid = Pexec(104, 0L, b, 0L)) == -EINVAL) {
>  	/* save the signal masks and signal handlers, the child may change
>            them */
>  		savpending = _sigpending;

To my surprise the Pexec() call returns indeed -EINVAL under plain TOS 2.06,
but I think it's not guaranteed that GEMDOS functions return defined error 
codes when called with invalid parameters (opcode 104 is an invalid parameter 
for plain TOS).  So I believe it's better not to rely on that behaviour and
to leave `thread.c' unchanged.

Bye,
Holger