mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-21 13:04:57 +02:00
2-29 C3
This commit is contained in:
parent
acebf2b325
commit
a1b32fa0e0
@ -73,6 +73,7 @@
|
|||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<OutDir>$(SolutionDir)bin\unittests\$(Platform)\$(Configuration)\</OutDir>
|
<OutDir>$(SolutionDir)bin\unittests\$(Platform)\$(Configuration)\</OutDir>
|
||||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
||||||
|
<IncludePath>$(SolutionDir)\win32posix\inc;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
@ -90,7 +91,8 @@
|
|||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)\win32posix</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>
|
||||||
|
</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#include "w32posix.h"
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include "test_helper.h"
|
#include "test_helper.h"
|
||||||
|
|
||||||
#define PORT "34912"
|
#define PORT "34912"
|
||||||
@ -7,6 +10,7 @@
|
|||||||
int listen_fd, accept_fd, connect_fd, ret;
|
int listen_fd, accept_fd, connect_fd, ret;
|
||||||
struct addrinfo hints,*servinfo;
|
struct addrinfo hints,*servinfo;
|
||||||
fd_set read_set, write_set, except_set;
|
fd_set read_set, write_set, except_set;
|
||||||
|
struct timeval time_val;
|
||||||
|
|
||||||
int
|
int
|
||||||
unset_nonblock(int fd)
|
unset_nonblock(int fd)
|
||||||
@ -129,11 +133,11 @@ socket_syncio_tests()
|
|||||||
ASSERT_INT_EQ(errno, EBADF);
|
ASSERT_INT_EQ(errno, EBADF);
|
||||||
FD_ZERO(&read_set);
|
FD_ZERO(&read_set);
|
||||||
FD_SET(20, &read_set);
|
FD_SET(20, &read_set);
|
||||||
ASSERT_INT_EQ(select(21, &read_set, NULL, NULL, NULL), -1);
|
ASSERT_INT_EQ(select(21, &read_set, NULL, NULL, &time_val), -1);
|
||||||
ASSERT_INT_EQ(errno, EBADF);
|
ASSERT_INT_EQ(errno, EBADF);
|
||||||
FD_ZERO(&write_set);
|
FD_ZERO(&write_set);
|
||||||
FD_SET(21, &write_set);
|
FD_SET(21, &write_set);
|
||||||
ASSERT_INT_EQ(select(22, NULL, &write_set, NULL, NULL), -1);
|
ASSERT_INT_EQ(select(22, NULL, &write_set, NULL, &time_val), -1);
|
||||||
ASSERT_INT_EQ(errno, EBADF);
|
ASSERT_INT_EQ(errno, EBADF);
|
||||||
TEST_DONE();
|
TEST_DONE();
|
||||||
|
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
#include "..\..\w32posix.h"
|
@ -0,0 +1 @@
|
|||||||
|
#include "..\w32posix.h"
|
@ -286,13 +286,7 @@ int w32_isatty(int fd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FILE* w32_fdopen(int fd, const char *mode) {
|
FILE* w32_fdopen(int fd, const char *mode) {
|
||||||
errno = 0;
|
CHECK_FD(fd);
|
||||||
if ((fd > MAX_FDS - 1) || fd_table.w32_ios[fd] == NULL) {
|
|
||||||
errno = EBADF;
|
|
||||||
debug("bad fd: %d", fd);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return fileio_fdopen(fd_table.w32_ios[fd], mode);
|
return fileio_fdopen(fd_table.w32_ios[fd], mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -488,12 +482,14 @@ int w32_select(int fds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, co
|
|||||||
|
|
||||||
|
|
||||||
int w32_dup(int oldfd) {
|
int w32_dup(int oldfd) {
|
||||||
|
CHECK_FD(oldfd);
|
||||||
errno = EOPNOTSUPP;
|
errno = EOPNOTSUPP;
|
||||||
debug("ERROR: dup is not implemented yet");
|
debug("ERROR: dup is not implemented yet");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int w32_dup2(int oldfd, int newfd) {
|
int w32_dup2(int oldfd, int newfd) {
|
||||||
|
CHECK_FD(oldfd);
|
||||||
errno = EOPNOTSUPP;
|
errno = EOPNOTSUPP;
|
||||||
debug("ERROR: dup2 is not implemented yet");
|
debug("ERROR: dup2 is not implemented yet");
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -145,6 +145,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="debug.h" />
|
<ClInclude Include="debug.h" />
|
||||||
<ClInclude Include="defs.h" />
|
<ClInclude Include="defs.h" />
|
||||||
|
<ClInclude Include="inc\sys\socket.h" />
|
||||||
|
<ClInclude Include="inc\unistd.h" />
|
||||||
<ClInclude Include="w32fd.h" />
|
<ClInclude Include="w32fd.h" />
|
||||||
<ClInclude Include="w32posix.h" />
|
<ClInclude Include="w32posix.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -13,6 +13,12 @@
|
|||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="inc">
|
||||||
|
<UniqueIdentifier>{bcb2ad09-217d-43e3-b3f0-0e95ef6b8023}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="inc\sys">
|
||||||
|
<UniqueIdentifier>{a8ebc7ed-da32-4692-82b6-6d49d420dd5b}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="socketio.c">
|
<ClCompile Include="socketio.c">
|
||||||
@ -44,5 +50,11 @@
|
|||||||
<ClInclude Include="debug.h">
|
<ClInclude Include="debug.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="inc\unistd.h">
|
||||||
|
<Filter>inc</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="inc\sys\socket.h">
|
||||||
|
<Filter>inc\sys</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
x
Reference in New Issue
Block a user