[Cbe-oss-dev] [PATCH] libspe2: opening null file returns no error

Kazunori Asayama asayama at sm.sony.co.jp
Wed Nov 21 00:56:50 EST 2007


D. Herrendoerfer wrote:
> This patch fixes a problem that opening a null file would
> return no error.
> 
> Signed-off-by: D. Herrendoerfer <herrend at de.ibm.com>
> 
> OK to apply ?

OK with me. And I guess that the freopen and other C99 handlers 
have the same problem. Could you look into them?

> 
> Index: libspe2/spebase/default_c99_handler.c
> ===================================================================
> --- libspe2/spebase/default_c99_handler.c       (revision 95)
> +++ libspe2/spebase/default_c99_handler.c       (working copy)
> @@ -919,8 +919,8 @@ static int default_c99_handler_fopen(cha
>      int i, rc = 0, err = EMFILE;
>  
>      DEBUG_PRINTF("%s\n", __func__);
> -    path = GET_LS_PTR(arg0->slot[0]);
> -    mode = GET_LS_PTR(arg1->slot[0]);
> +    path = GET_LS_PTR_NULL(arg0->slot[0]);
> +    mode = GET_LS_PTR_NULL(arg1->slot[0]);
>      pthread_mutex_lock(&spe_c99_file_mutex);
>      if (nr_spe_FILE_ptrs < SPE_FOPEN_MAX) {
>         for (i = SPE_FOPEN_MIN; i < SPE_FOPEN_MAX; i++) {
> 
> 
> _______________________________________________
> cbe-oss-dev mailing list
> cbe-oss-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/cbe-oss-dev
> 
> 




More information about the cbe-oss-dev mailing list