Skip to content
Snippets Groups Projects
Commit fbd175c0 authored by Matthias Grob's avatar Matthias Grob
Browse files

posix-shell server: switch pipe flag to read/write

to make it non-blocking and ommit opening the same
named pipe multiple times inside the same process
which seems to be not supported in cygwin.
parent 9887c463
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,13 @@
#include "pxh.h"
#include "server.h"
// In Cygwin opening and closing the same named pipe multiple times within one process doesn't work POSIX compliant.
// As a workaround we open the client send pipe file in read write mode such that we can keep it open all the time.
#if !defined(__PX4_CYGWIN)
#define CLIENT_SEND_PIPE_OFLAGS O_RDONLY
#else
#define CLIENT_SEND_PIPE_OFLAGS O_RDWR
#endif
namespace px4_daemon
{
......@@ -121,7 +127,7 @@ Server::_server_main(void *arg)
}
std::string client_send_pipe_path = get_client_send_pipe_path(_instance_id);
int client_send_pipe_fd = open(client_send_pipe_path.c_str(), O_RDONLY);
int client_send_pipe_fd = open(client_send_pipe_path.c_str(), CLIENT_SEND_PIPE_OFLAGS);
while (true) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment