windows-tests-torture-20090226
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 26 Feb 2009 17:46:32 +0000 (17:46 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 26 Feb 2009 17:46:32 +0000 (17:46 +0000)
LICENSE MIT

fix error message

create a file of the specified size

src/WINNT/tests/torture/Source/WinThreads.c
src/WINNT/tests/torture/Source/nbio.c

index 3979057..5ec893f 100644 (file)
@@ -386,7 +386,7 @@ BOOL run_netbench(int client, char *ClientText, char *PathToSecondDir)
             printf("ERROR: You are using a dbench 1 load file\n");
             if (GetHandleInformation((HANDLE)hWinEventHandle, &dwFlags))
                 break;
-               }
+        }
         if (!strcmp(params[0], "BM_SETUP"))
         {
             bm_state = BM_SETUP;
index 74760a1..b00cac1 100644 (file)
@@ -286,7 +286,7 @@ int nb_CreateFile(char *path, DWORD size)
     sprintf(FileName, "Thread_%05d.log", ProcessNumber);
     if (strlen(path) == 0)
     {
-        return(LeaveThread(1, "nb_DeleteFile failed no path specified\n", CMD_CREATEFILE));
+        return(LeaveThread(1, "nb_CreateFile failed no path specified\n", CMD_CREATEFILE));
     }
 
     strcpy(NewPath, path);
@@ -312,7 +312,7 @@ int nb_CreateFile(char *path, DWORD size)
     }
     EndFirstTimer(CMD_CREATEFILE, 1);
     Moved = SetFilePointer(fHandle,
-                           size,
+                           size - sizeof(Buffer) <= 0 ? 0 : size - sizeof(Buffer),
                            NULL,
                            FILE_BEGIN);
     memset(Buffer, 'A', sizeof(Buffer));