changeset 21705:829b1f30a07f

fix compilation on the most delicious variant of unix (mingw) that lacks S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
author nicodvb
date Thu, 21 Dec 2006 22:40:51 +0000
parents 8b87dc8cbd5d
children d776feb3d582
files stream/stream_file.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_file.c	Thu Dec 21 22:11:47 2006 +0000
+++ b/stream/stream_file.c	Thu Dec 21 22:40:51 2006 +0000
@@ -135,8 +135,13 @@
   } else {
     if(mode == STREAM_READ)
       f=open(filename,m);
-    else
-      f=open(filename,m, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
+    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);