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

D. Herrendoerfer d.herrendoerfer at herrendoerfer.name
Tue Nov 20 21:12:35 EST 2007


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 ?

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++) {





More information about the cbe-oss-dev mailing list