Merge lp:~ignacio-nin/sysbench/0.5-bug1262178 into lp:sysbench

Proposed by Ignacio Nin
Status: Merged
Approved by: Alexey Kopytov
Approved revision: 120
Merged at revision: 120
Proposed branch: lp:~ignacio-nin/sysbench/0.5-bug1262178
Merge into: lp:sysbench
Diff against target: 15 lines (+2/-2)
1 file modified
sysbench/tests/fileio/sb_fileio.c (+2/-2)
To merge this branch: bzr merge lp:~ignacio-nin/sysbench/0.5-bug1262178
Reviewer Review Type Date Requested Status
Alexey Kopytov Approve
Review via email: mp+199448@code.launchpad.net

Description of the change

Fix for bug #1262178

To test:
$ sysbench --test=fileio --file-num=1 --file-total-size=1M prepare
$ sysbench --test=fileio --file-num=1 --file-total-size=1M --file-io-mode=mmap --file-test-mode=seqwr run

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

According to http://msdn.microsoft.com/en-us/library/windows/desktop/aa366563%28v=vs.85%29.aspx the return value of FlushViewOfFile differs from the UNIX paragidm, i.e. zero on error and a nonzero value on success. So the Windows codepath should be

return !FlushViewOfFile(...);

I will fix it in the merge.

review: Approve
Revision history for this message
Ignacio Nin (ignacio-nin) wrote :

> According to http://msdn.microsoft.com/en-
> us/library/windows/desktop/aa366563%28v=vs.85%29.aspx the return value of
> FlushViewOfFile differs from the UNIX paragidm, i.e. zero on error and a
> nonzero value on success. So the Windows codepath should be
>
> return !FlushViewOfFile(...);

Classic Microsoft ;)

>
> I will fix it in the merge.

Thank you for your time!!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sysbench/tests/fileio/sb_fileio.c'
2--- sysbench/tests/fileio/sb_fileio.c 2013-07-04 06:28:56 +0000
3+++ sysbench/tests/fileio/sb_fileio.c 2013-12-18 12:17:48 +0000
4@@ -1502,9 +1502,9 @@
5 else if (file_io_mode == FILE_IO_MODE_MMAP)
6 {
7 #ifndef _WIN32
8- msync(mmaps[file_id], file_size, MS_SYNC | MS_INVALIDATE);
9+ return msync(mmaps[file_id], file_size, MS_SYNC | MS_INVALIDATE);
10 #else
11- FlushViewOfFile(mmaps[file_id], (size_t)file_size);
12+ return FlushViewOfFile(mmaps[file_id], (size_t)file_size);
13 #endif
14 }
15 #endif

Subscribers

People subscribed via source and target branches

to status/vote changes: