diff src/os/win32/ngx_files.c @ 461:a88a3e4e158f release-0.1.5

nginx-0.1.5-RELEASE import *) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
author Igor Sysoev <igor@sysoev.ru>
date Thu, 11 Nov 2004 14:07:14 +0000
parents ded1284520cc
children bbd6b0b4a2b1
line wrap: on
line diff
--- a/src/os/win32/ngx_files.c
+++ b/src/os/win32/ngx_files.c
@@ -18,19 +18,20 @@ ssize_t ngx_read_file(ngx_file_t *file, 
     if (ngx_win32_version < NGX_WIN_NT) {
 
         /*
-         * in Win9X the overlapped pointer must be NULL
-         * so we need to use SetFilePointer() to set the offset
+         * under Win9X the overlapped pointer must be NULL
+         * so we have to use SetFilePointer() to set the offset
          */
 
         if (file->offset != offset) {
 
             /*
-             * the maximum file size on FAT16 is 2G, but on FAT32
-             * the size is 4G so we need to use high_offset
+             * the maximum file size on the FAT16 is 2G, but on the FAT32
+             * the size is 4G so we have to use the high_offset
              * because a single offset is signed value
              */
 
             high_offset = (long) (offset >> 32);
+
             if (SetFilePointer(file->fd, (long) offset, &high_offset,
                                FILE_BEGIN) == INVALID_SET_FILE_POINTER)
             {
@@ -81,15 +82,15 @@ ssize_t ngx_write_file(ngx_file_t *file,
     if (ngx_win32_version < NGX_WIN_NT) {
 
         /*
-         * in Win9X the overlapped pointer must be NULL
-         * so we need to use SetFilePointer() to set the offset
+         * under Win9X the overlapped pointer must be NULL
+         * so we have to use SetFilePointer() to set the offset
          */
 
         if (file->offset != offset) {
 
             /*
-             * the maximum file size on FAT16 is 2G, but on FAT32
-             * the size is 4G so we need to use high_offset
+             * the maximum file size on the FAT16 is 2G, but on the FAT32
+             * the size is 4G so we have to use high_offset
              * because a single offset is signed value
              */
 
@@ -189,8 +190,7 @@ int ngx_win32_rename_file(ngx_str_t *fro
     do {
         num = ngx_next_temp_number(collision);
 
-        ngx_snprintf((char *) name + to->len, 1 + 10 + 1 + sizeof("DELETE"),
-                     ".%010u.DELETE", num);
+        ngx_sprintf(name + to->len, ".%010u.DELETE", num);
 
         if (MoveFile((const char *) to->data, (const char *) name) == 0) {
             collision = 1;