Added patchset to fix copy and paste errors and ugly coding style in recently committed ws32 patch.

This commit is contained in:
Sebastian Lackner 2014-11-29 11:29:23 +01:00
parent db0fd400e4
commit 4afa857aee
4 changed files with 147 additions and 0 deletions

1
debian/changelog vendored
View File

@ -15,6 +15,7 @@ wine-compholio (1.7.32) UNRELEASED; urgency=low
* Added patch to ensure wintrust resets data->pWintrustData->u.pFile->hFile after closing handle.
* Added patch to add additional format conversions for DXT1 and DXT3.
* Added patch to implement stubs for additional api-ms-win-core-* dlls.
* Added patch to fix copy and paste error recently introduced in ws2_32 tests.
* Removed patch to close server fd is there is no space in thread inflight fd list (accepted upstream).
* Removed patch to fix bugs in StrStr functions (accepted upstream).
* Removed patches to avoid sending messages in FindWindowExW (accepted upstream).

View File

@ -121,6 +121,7 @@ PATCHLIST := \
wintrust-Reset_hFile.ok \
wpcap-Dynamic_Linking.ok \
ws2_32-Connect_Time.ok \
ws2_32-Overlapping_FDS.ok \
ws2_32-TransmitFile.ok \
ws2_32-WriteWatches.ok \
wtsapi32-EnumerateProcesses.ok
@ -1937,6 +1938,20 @@ ws2_32-Connect_Time.ok:
echo '+ { "Sebastian Lackner", "ws2_32: Implement returning the proper time with SO_CONNECT_TIME.", 1 },'; \
) > ws2_32-Connect_Time.ok
# Patchset ws2_32-Overlapping_FDS
# |
# | Modified files:
# | * dlls/ws2_32/socket.c, dlls/ws2_32/tests/sock.c
# |
.INTERMEDIATE: ws2_32-Overlapping_FDS.ok
ws2_32-Overlapping_FDS.ok:
$(call APPLY_FILE,ws2_32-Overlapping_FDS/0001-ws2_32-tests-Fix-several-copy-and-paste-errors.patch)
$(call APPLY_FILE,ws2_32-Overlapping_FDS/0002-ws2_32-Improve-implementation-of-get_poll_results.patch)
@( \
echo '+ { "Sebastian Lackner", "ws2_32/tests: Fix several copy and paste errors.", 1 },'; \
echo '+ { "Sebastian Lackner", "ws2_32: Improve implementation of get_poll_results.", 1 },'; \
) > ws2_32-Overlapping_FDS.ok
# Patchset ws2_32-TransmitFile
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,60 @@
From 93eaea5931b6aa60b1d4edf9c39cfc7274c47e39 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 29 Nov 2014 09:55:39 +0100
Subject: ws2_32/tests: Fix several copy and paste errors.
---
dlls/ws2_32/tests/sock.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 106588d..16f98c0 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -3358,14 +3358,14 @@ static void test_select(void)
ret = select(maxfd+1, &readfds, &readfds, NULL, &select_timeout);
ok(ret == 2, "select returned %d\n", ret);
ok(FD_ISSET(fdWrite, &readfds), "fdWrite socket is not in the set\n");
- ok(FD_ISSET(fdRead, &readfds), "fdWrite socket is not in the set\n");
+ ok(FD_ISSET(fdRead, &readfds), "fdRead socket is not in the set\n");
ok(send(fdWrite, "test", 4, 0) == 4, "failed to send data\n");
FD_ZERO(&readfds);
FD_SET(fdRead, &readfds);
ret = select(fdRead+1, &readfds, NULL, NULL, &select_timeout);
ok(ret == 1, "select returned %d\n", ret);
- ok(FD_ISSET(fdRead, &readfds), "fdWrite socket is not in the set\n");
+ ok(FD_ISSET(fdRead, &readfds), "fdRead socket is not in the set\n");
FD_ZERO(&readfds);
FD_SET(fdWrite, &readfds);
@@ -3373,7 +3373,7 @@ static void test_select(void)
ret = select(maxfd+1, &readfds, &readfds, NULL, &select_timeout);
ok(ret == 2, "select returned %d\n", ret);
ok(FD_ISSET(fdWrite, &readfds), "fdWrite socket is not in the set\n");
- ok(FD_ISSET(fdRead, &readfds), "fdWrite socket is not in the set\n");
+ ok(FD_ISSET(fdRead, &readfds), "fdRead socket is not in the set\n");
while(1) {
FD_ZERO(&writefds);
@@ -3388,7 +3388,7 @@ static void test_select(void)
ret = select(maxfd+1, &readfds, &readfds, NULL, &select_timeout);
ok(ret == 1, "select returned %d\n", ret);
ok(!FD_ISSET(fdWrite, &readfds), "fdWrite socket is in the set\n");
- ok(FD_ISSET(fdRead, &readfds), "fdWrite socket is not in the set\n");
+ ok(FD_ISSET(fdRead, &readfds), "fdRead socket is not in the set\n");
ok(send(fdRead, "test", 4, 0) == 4, "failed to send data\n");
Sleep(100);
@@ -3398,7 +3398,7 @@ static void test_select(void)
ret = select(maxfd+1, &readfds, &readfds, NULL, &select_timeout);
ok(ret == 2, "select returned %d\n", ret);
ok(FD_ISSET(fdWrite, &readfds), "fdWrite socket is not in the set\n");
- ok(FD_ISSET(fdRead, &readfds), "fdWrite socket is not in the set\n");
+ ok(FD_ISSET(fdRead, &readfds), "fdRead socket is not in the set\n");
closesocket(fdRead);
closesocket(fdWrite);
--
2.1.3

View File

@ -0,0 +1,71 @@
From f99ad6da713e01db0db819cad23c59e3d5ba2886 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 29 Nov 2014 11:18:18 +0100
Subject: ws2_32: Improve implementation of get_poll_results.
The recent commit to allow overlapping fd sets made the implementation a bit ugly -
at some points elements in fds[...] are accessed with j, at other points its accessed
using other indices. By using pointers instead we can make that code look much simpler.
---
dlls/ws2_32/socket.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 29ac800..79c5a30 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -4386,36 +4386,37 @@ static void release_poll_fds( const WS_fd_set *readfds, const WS_fd_set *writefd
static int get_poll_results( WS_fd_set *readfds, WS_fd_set *writefds, WS_fd_set *exceptfds,
const struct pollfd *fds )
{
- unsigned int exceptfds_off = (readfds ? readfds->fd_count : 0) + (writefds ? writefds->fd_count : 0);
- unsigned int i, j = 0, k, total = 0;
+ const struct pollfd *poll_writefds = fds + (readfds ? readfds->fd_count : 0);
+ const struct pollfd *poll_exceptfds = poll_writefds + (writefds ? writefds->fd_count : 0);
+ unsigned int i, k, total = 0;
if (readfds)
{
- for (i = k = 0; i < readfds->fd_count; i++, j++)
+ for (i = k = 0; i < readfds->fd_count; i++)
{
-
- if (fds[j].revents ||
- (readfds==writefds && (fds[readfds->fd_count+i].revents & POLLOUT) &&
- !(fds[readfds->fd_count+i].revents & POLLHUP)) ||
- (readfds==exceptfds && fds[exceptfds_off+i].revents))
+ if (fds[i].revents ||
+ (readfds == writefds && (poll_writefds[i].revents & POLLOUT) && !(poll_writefds[i].revents & POLLHUP)) ||
+ (readfds == exceptfds && poll_exceptfds[i].revents))
readfds->fd_array[k++] = readfds->fd_array[i];
}
readfds->fd_count = k;
total += k;
}
- if (writefds && writefds!=readfds)
+ if (writefds && writefds != readfds)
{
- for (i = k = 0; i < writefds->fd_count; i++, j++)
- if (((fds[j].revents & POLLOUT) && !(fds[j].revents & POLLHUP)) ||
- (writefds==exceptfds && fds[exceptfds_off+i].revents))
+ for (i = k = 0; i < writefds->fd_count; i++)
+ {
+ if (((poll_writefds[i].revents & POLLOUT) && !(poll_writefds[i].revents & POLLHUP)) ||
+ (writefds == exceptfds && poll_exceptfds[i].revents))
writefds->fd_array[k++] = writefds->fd_array[i];
+ }
writefds->fd_count = k;
total += k;
}
- if (exceptfds && exceptfds!=readfds && exceptfds!=writefds)
+ if (exceptfds && exceptfds != readfds && exceptfds != writefds)
{
for (i = k = 0; i < exceptfds->fd_count; i++)
- if (fds[exceptfds_off+i].revents) exceptfds->fd_array[k++] = exceptfds->fd_array[i];
+ if (poll_exceptfds[i].revents) exceptfds->fd_array[k++] = exceptfds->fd_array[i];
exceptfds->fd_count = k;
total += k;
}
--
2.1.3