mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-31 17:10:47 +08:00
[svn-r9746] Purpose:
Bug fix. Description: creat(name, (mode_t)0777) is used to create a new file. However, creat() is not available in Visual Studio. Solution: Use a Win32 macro so _creat() will be used on Windows and creat() will be used on Unix. #ifdef WIN32 fd = _creat(name, _S_IREAD | _S_IWRITE); #else /* WIN32 */ fd = creat(name,(mode_t)0777); #endif /* WIN32 */ (Note: At first, I tried to define HDcreat() as _creat() for WIN32 and creat() for other platforms in H5private.h. But _creat() and creat() use different parameters for file permission settings. So, I added the WIN32 macro in h5jamgentest.c.) Platforms tested: Heping (Linux) Visual C++ 6.0 on Windows XP/2000. .NET on Windows XP. (Tested with SZIP-with-encoder and SZIP-without-encoder). Misc. update:
This commit is contained in:
parent
63f32322e8
commit
4707b280f8
@ -551,7 +551,11 @@ int fd;
|
||||
size_t i;
|
||||
char *bp;
|
||||
|
||||
#ifdef WIN32
|
||||
fd = _creat(name, _S_IREAD | _S_IWRITE);
|
||||
#else /* WIN32 */
|
||||
fd = creat(name,(mode_t)0777);
|
||||
#endif /* WIN32 */
|
||||
if (fd < 0) {
|
||||
/* panic */
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user