summaryrefslogtreecommitdiff
path: root/ambd/main.cpp
diff options
context:
space:
mode:
authorSangjung Woo <sangjung.woo@samsung.com>2016-12-22 11:24:51 +0900
committerSangjung Woo <sangjung.woo@samsung.com>2016-12-23 17:06:07 +0900
commit5b9c64147350ccd7859765c1a5cb3323826f2e29 (patch)
tree9cc25edebe2d54a8e638a2f1ce27b72e11ff8fdd /ambd/main.cpp
parentbe3f71efda71a23251324877e13cc8dec0f5b1f3 (diff)
downloadautomotive-message-broker-5b9c64147350ccd7859765c1a5cb3323826f2e29.tar.gz
fixed the warning message when enabling -Wall option
This patch fixed the below warning messages. - warning: comparison between signed and unsigned integer expressions - warning: no return statement in function returning non-void - warning: statement has no effect - warning: unused variable - warning: when initialized here [-Wreorder] - warning: control reaches end of non-void function [-Wreturn-type] - warning: ‘VehicleProperty::ButtonEvent’ is deprecated: Deprecated in 0.14. Use ButtonEventW3C [-Wdeprecated-declarations] - warning: ignoring return value of 'int dup(int)', declared with attribute warn_unused_result [-Wunused-result] - warning: suggest parentheses around '&&' within '||' [-Wparentheses] - warning: 'connection' may be used uninitialized in this function [-Wmaybe-uninitialized] - warning: suggest parentheses around assignment used as truth value - warning: dereferencing type-punned pointer will break strict-aliasing rules Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Diffstat (limited to 'ambd/main.cpp')
-rw-r--r--ambd/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/ambd/main.cpp b/ambd/main.cpp
index d39c2d68..ff5eb9cf 100644
--- a/ambd/main.cpp
+++ b/ambd/main.cpp
@@ -201,6 +201,13 @@ void daemonize()
{
close(i); // close all descriptors
}
+
+
+ // handle standard I/O
+ i = open("/dev/null", O_RDWR);
+ dup2(i, STDIN_FILENO);
+ dup2(i, STDOUT_FILENO);
+ dup2(i, STDERR_FILENO);
{ // handle standard I/O
i = open("/dev/null", O_RDWR);
dup(i);