[openib-general] [PATCH] osm: 'chmod' on Windows

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Sun Nov 26 05:22:48 PST 2006


Hi Hal

Fixing to match 'chmod' implementation on Windows.
Note that on Windows 'chmod' there's no such thing 
as user/group/all permissions - the permissions are 
aways for 'all'.
Don't see why this would be a problem in this case,
but still - worth mentioning.

--
Yevgeny

Signed-off-by:  Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
 
Index: opensm/osm_sa.c
===================================================================
--- opensm/osm_sa.c	(revision 10161)
+++ opensm/osm_sa.c	(working copy)
@@ -70,6 +70,9 @@
 #include <opensm/osm_multicast.h>
 #include <opensm/osm_inform.h>
 #include <opensm/osm_service.h>
+#ifdef WIN32
+#include <io.h>
+#endif /* WIN32 */
 
 #define  OSM_SA_INITIAL_TID_VALUE 0xabc
 
@@ -569,7 +572,11 @@ opensm_dump_to_file(osm_opensm_t *p_osm,
 		return -1;
 	}
 
+#ifndef WIN32
 	chmod(path, S_IRUSR|S_IWUSR);
+#else
+	_chmod(path, _S_IREAD|_S_IWRITE);
+#endif
 
 	dump_func(p_osm, file);
 




More information about the general mailing list