From ab0691760f4cdd2fe8bded4700d051ea1ba51856 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 26 Feb 2009 17:46:32 +0000 Subject: [PATCH] windows-tests-torture-20090226 LICENSE MIT fix error message create a file of the specified size --- src/WINNT/tests/torture/Source/WinThreads.c | 2 +- src/WINNT/tests/torture/Source/nbio.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WINNT/tests/torture/Source/WinThreads.c b/src/WINNT/tests/torture/Source/WinThreads.c index 3979057cfc..5ec893fc90 100644 --- a/src/WINNT/tests/torture/Source/WinThreads.c +++ b/src/WINNT/tests/torture/Source/WinThreads.c @@ -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; diff --git a/src/WINNT/tests/torture/Source/nbio.c b/src/WINNT/tests/torture/Source/nbio.c index 74760a10da..b00cac1732 100644 --- a/src/WINNT/tests/torture/Source/nbio.c +++ b/src/WINNT/tests/torture/Source/nbio.c @@ -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));