summaryrefslogtreecommitdiffstats
path: root/tools/misc/h5repart.c
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2008-06-05 18:52:19 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2008-06-05 18:52:19 (GMT)
commit532e23b808886527c6037c876ea6b203db16bcff (patch)
tree34f6a6c3e945a6ce9461a7b880f3b890c364ddd2 /tools/misc/h5repart.c
parent92d070ab393fdd64267dfe53f55d39ef17c52257 (diff)
downloadhdf5-532e23b808886527c6037c876ea6b203db16bcff.zip
hdf5-532e23b808886527c6037c876ea6b203db16bcff.tar.gz
hdf5-532e23b808886527c6037c876ea6b203db16bcff.tar.bz2
[svn-r15150] Purpose: Separate Windows function macro definitions to win32defs.h
Description: In library code, we try not to use system calls directly, but instead use the HD{function} macro instead. This way, we can map special versions of the call on particular systems. Previously, it was all done in H5private.h. However, in an effort to clean up platform-specific definitions, we move all of the Windows macros into a separate file, win32defs.h. This way, we can use the non-Posix versions that Visual Studio sends warnings about. Some macros are set specifically in the platform-specific header files. Then, any macros left unset will be set by the "default" implementation in H5private.h. This checkin also cleans up various source files to use the HD* macros when possible. Tested: VS2005 on WinXP VS.NET on WinXP h5committest (kagiso, linew, smirom)
Diffstat (limited to 'tools/misc/h5repart.c')
-rw-r--r--tools/misc/h5repart.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c
index 505b9e4..f107e31 100644
--- a/tools/misc/h5repart.c
+++ b/tools/misc/h5repart.c
@@ -320,7 +320,7 @@ main (int argc, char *argv[])
need_write = FALSE;
} else if (src_offset<src_act_size) {
n = (size_t)MIN ((off_t)n, src_act_size-src_offset);
- if ((nio=read (src, buf, n))<0) {
+ if ((nio=HDread (src, buf, n))<0) {
perror ("read");
exit (1);
} else if ((size_t)nio!=n) {
@@ -347,7 +347,7 @@ main (int argc, char *argv[])
perror ("HDlseek");
exit (1);
}
- if ((nio=write (dst, buf, n))<0) {
+ if ((nio=HDwrite (dst, buf, n))<0) {
perror ("write");
exit (1);
} else if ((size_t)nio!=n) {
@@ -369,7 +369,7 @@ main (int argc, char *argv[])
*/
src_offset += n;
if (src_offset==src_act_size) {
- close (src);
+ HDclose (src);
if (!src_is_family) {
dst_offset += n;
break;
@@ -407,7 +407,7 @@ main (int argc, char *argv[])
perror ("HDHDlseek");
exit (1);
}
- if (read (dst, buf, 1)<0) {
+ if (HDread (dst, buf, 1)<0) {
perror ("read");
exit (1);
}
@@ -415,12 +415,12 @@ main (int argc, char *argv[])
perror ("HDlseek");
exit (1);
}
- if (write (dst, buf, 1)<0) {
+ if (HDwrite (dst, buf, 1)<0) {
perror ("write");
exit (1);
}
}
- close (dst);
+ HDclose (dst);
sprintf (dst_name, dst_gen_name, ++dst_membno);
if ((dst=HDopen (dst_name, O_RDWR|O_CREAT|O_TRUNC, 0666))<0) {
perror (dst_name);
@@ -442,7 +442,7 @@ main (int argc, char *argv[])
perror ("HDlseek");
exit (1);
}
- if (read (dst, buf, 1)<0) {
+ if (HDread (dst, buf, 1)<0) {
perror ("read");
exit (1);
}
@@ -450,12 +450,12 @@ main (int argc, char *argv[])
perror ("HDlseek");
exit (1);
}
- if (write (dst, buf, 1)<0) {
+ if (HDwrite (dst, buf, 1)<0) {
perror ("write");
exit (1);
}
}
- close (dst);
+ HDclose (dst);
/* Modify family driver information saved in superblock through private property.
* These private properties are for this tool only. */