[MPlayer-dev-eng] [PATCH] remove open special-case in strem_file.c

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Feb 20 11:57:16 CET 2008


Hello,
since the mode is always ignored when O_CREAT is not set, I can see no
reason to have a special case for mode == STREAM_READ that uses the open
function without mode parameter.
Attached patch thus removes this case.
Ok to apply, or do you expect this might cause problems on some weird
systems?
-------------- next part --------------
diff --git a/stream/stream_file.c b/stream/stream_file.c
index 810d8bf..c8a0392 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -133,15 +133,11 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
 #endif
     }
   } else {
-    if(mode == STREAM_READ)
-      f=open(filename,m);
-    else {
       mode_t openmode = S_IRUSR|S_IWUSR;
 #ifndef __MINGW32__
       openmode |= S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;
 #endif
       f=open(filename,m, openmode);
-    }
     if(f<0) {
       mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename);
       m_struct_free(&stream_opts,opts);


More information about the MPlayer-dev-eng mailing list