Build Linux with VCPKG instead; previously explicitly cloning CPPRESTSDK and manually building. Now, VCPKG and CPPRESTSDK must be built before building RPC. See Build.md for build notes.
This commit is contained in:
@@ -37,6 +37,10 @@ if (${BUILD_LIBRARY})
|
||||
add_definitions(-D BUILD_LIBRARY)
|
||||
endif (${BUILD_LIBRARY})
|
||||
|
||||
if (${NO_SELECT})
|
||||
add_definitions(-D NO_SELECT)
|
||||
endif (${NO_SELECT})
|
||||
|
||||
add_definitions( -D_POSIX )
|
||||
|
||||
else (UNIX)
|
||||
@@ -183,16 +187,5 @@ target_link_libraries (
|
||||
|
||||
endif (BUILD_LIBRARY)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
endif (UNIX)
|
||||
|
||||
|
@@ -105,13 +105,17 @@ static ssize_t mei_recv_msg(struct mei *me, unsigned char *buffer, ssize_t len,
|
||||
|
||||
static ssize_t mei_send_msg(struct mei *me, const unsigned char *buffer, ssize_t len, unsigned long timeout)
|
||||
{
|
||||
#ifndef NO_SELECT
|
||||
struct timeval tv;
|
||||
#endif
|
||||
ssize_t written;
|
||||
ssize_t rc;
|
||||
fd_set set;
|
||||
|
||||
#ifndef NO_SELECT
|
||||
tv.tv_sec = timeout / 1000;
|
||||
tv.tv_usec = (timeout % 1000) * 1000000;
|
||||
#endif
|
||||
|
||||
mei_msg(me, "call write length = %zd, cmd=%d\n", len, (int)buffer[0]);
|
||||
|
||||
@@ -123,7 +127,7 @@ static ssize_t mei_send_msg(struct mei *me, const unsigned char *buffer, ssize_t
|
||||
mei_err(me, "write failed with status %zd %s\n", written, strerror(errno));
|
||||
goto out;
|
||||
}
|
||||
|
||||
#ifndef NO_SELECT
|
||||
FD_ZERO(&set);
|
||||
FD_SET(me->fd, &set);
|
||||
rc = select(me->fd + 1 , NULL, &set, NULL, &tv);
|
||||
@@ -136,7 +140,7 @@ static ssize_t mei_send_msg(struct mei *me, const unsigned char *buffer, ssize_t
|
||||
mei_err(me, "write failed on select with status %zd\n", rc);
|
||||
goto out;
|
||||
}
|
||||
|
||||
#endif
|
||||
rc = written;
|
||||
out:
|
||||
sem_post(&(me->Lock));
|
||||
|
Reference in New Issue
Block a user