From b4c4e1dcb3f6e0e46278e5832972fc34e6507769 Mon Sep 17 00:00:00 2001 From: NeitrinoK Date: Wed, 24 May 2023 01:00:10 +0300 Subject: [PATCH] Fix compilation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` user@o0004238:~/nocc$ make client go build -o bin/nocc-daemon -trimpath -ldflags '-s -w -X "github.com/VKCOM/nocc/internal/common.version=v1.2, rev 73b26e5, compiled at 2023-05-23 21:54:34 UTC"' cmd/nocc-daemon/main.go g++ -std=c++11 -O3 cmd/nocc.cpp -o bin/nocc cmd/nocc.cpp: In function ‘void start_daemon_in_background()’: cmd/nocc.cpp:130:7: warning: ignoring return value of ‘int pipe(int*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 130 | pipe(pipd); | ~~~~^~~~~~ ``` --- cmd/nocc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/nocc.cpp b/cmd/nocc.cpp index 4fae7a9..cf20a85 100644 --- a/cmd/nocc.cpp +++ b/cmd/nocc.cpp @@ -127,7 +127,9 @@ void start_daemon_in_background() { } int pipd[2]; - pipe(pipd); + if (pipe(pipd) == -1) { + execute_cxx_locally("could not start daemon", errno); + }; int pid = fork(); if (pid < 0) {