From 70ed509689e4b0314c61508ab08dbe186a7ac225 Mon Sep 17 00:00:00 2001 From: Alexey Chernobaev Date: Tue, 28 Aug 2018 23:12:03 +0300 Subject: [PATCH] commands reply implemented (in socket mode) --- profctl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/profctl.c b/profctl.c index 26f2173..881ff1b 100644 --- a/profctl.c +++ b/profctl.c @@ -701,6 +701,10 @@ int main(int argc, char **argv) if (ctrl_file_in == NULL) { log_system_error_and_exit("fdopen(control,r)"); } + ctrl_file_out = fdopen(s, "w"); + if (ctrl_file_out == NULL) { + log_system_error_and_exit("fdopen(control,w)"); + } } if (dataPort > 0) { @@ -763,6 +767,10 @@ int main(int argc, char **argv) SimpleThread(&outstat); } } + if (ctrl_file_out != NULL) { // echo input line + fprintf(ctrl_file_out, "%s\n", line); + fflush(ctrl_file_out); + } } // while return 0; -- 2.7.4