diff options
| author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-03-30 18:01:48 (GMT) |
|---|---|---|
| committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-03-30 18:01:48 (GMT) |
| commit | 5a1359a5e8aa149cea117f4f34239cd3a23872f4 (patch) | |
| tree | 85a0e53462d5b6da6b74451e0c3f9d59004369ed /unix/tclUnixFCmd.c | |
| parent | edb3e7b8d2efcb3a1282f910f1e7120d5d34c6f8 (diff) | |
| download | tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.zip tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.tar.gz tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.tar.bz2 | |
TIP 660. No compiler warnings. Tests suite pass on Win and Ubuntu
Diffstat (limited to 'unix/tclUnixFCmd.c')
| -rw-r--r-- | unix/tclUnixFCmd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index b8911df..10292f0 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -549,7 +549,7 @@ TclUnixCopyFile( int srcFd, dstFd; size_t blockSize; /* Optimal I/O blocksize for filesystem */ char *buffer; /* Data buffer for copy */ - size_t nread; + ssize_t nread; #ifdef DJGPP #define BINMODE |O_BINARY @@ -606,18 +606,18 @@ TclUnixCopyFile( buffer = (char *)Tcl_Alloc(blockSize); while (1) { nread = read(srcFd, buffer, blockSize); - if ((nread == TCL_IO_FAILURE) || (nread == 0)) { + if ((nread == -1) || (nread == 0)) { break; } - if ((size_t) write(dstFd, buffer, nread) != nread) { - nread = TCL_IO_FAILURE; + if (write(dstFd, buffer, nread) != nread) { + nread = -1; break; } } Tcl_Free(buffer); close(srcFd); - if ((close(dstFd) != 0) || (nread == TCL_IO_FAILURE)) { + if ((close(dstFd) != 0) || (nread == -1)) { unlink(dst); /* INTL: Native. */ return TCL_ERROR; } @@ -2052,7 +2052,7 @@ TclpObjNormalizePath( nativePath = Tcl_UtfToExternalDString(NULL, path,nextCheckpoint, &ds); if (Realpath(nativePath, normPath) != NULL) { - size_t newNormLen; + Tcl_Size newNormLen; wholeStringOk: newNormLen = strlen(normPath); |
