Commit f994e0a6 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntdll: Fill the IOSB in sock_recv() only inside the "if (alerted)" block.

We can only get a successful status that way. This avoids an uninitialized variable warning with gcc 12.2.
parent 6b16ead6
......@@ -23,6 +23,7 @@
#endif
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
......@@ -879,24 +880,25 @@ static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
}
SERVER_END_REQ;
/* the server currently will never succeed immediately */
assert(status == STATUS_ALERTED || status == STATUS_PENDING || NT_ERROR(status));
alerted = status == STATUS_ALERTED;
if (alerted)
{
status = try_recv( fd, async, &information );
if (status == STATUS_DEVICE_NOT_READY && (force_async || !nonblocking))
status = STATUS_PENDING;
}
if (status != STATUS_PENDING)
{
if (!NT_ERROR(status) || (wait_handle && !alerted))
if (!NT_ERROR(status) && status != STATUS_PENDING)
{
io->Status = status;
io->Information = information;
}
release_fileio( &async->io );
}
if (status != STATUS_PENDING)
release_fileio( &async->io );
if (alerted) set_async_direct_result( &wait_handle, status, information, FALSE );
if (wait_handle) status = wait_async( wait_handle, options & FILE_SYNCHRONOUS_IO_ALERT );
return status;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment