From: Woongsuk Cho Date: Thu, 4 Oct 2018 23:11:31 +0000 (+0900) Subject: assgin return value to unused variable to avoid build warning message X-Git-Tag: accepted/tizen/unified/20181010.061750 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2F20181010.061750;p=platform%2Fcore%2Fdotnet%2Flauncher.git assgin return value to unused variable to avoid build warning message --- diff --git a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc index 9757464..c7e28e8 100644 --- a/NativeLauncher/launcher/dotnet/dotnet_launcher.cc +++ b/NativeLauncher/launcher/dotnet/dotnet_launcher.cc @@ -121,36 +121,39 @@ static void setEnvFromFile() } } +#define _unused(x) ((void)(x)) + struct sigaction sig_abrt_new; struct sigaction sig_abrt_old; static bool checkOnSigabrt = false; + static void onSigabrt(int signum) { - // ignore return value of write(). - // this function is called when process go to die - // there is no need to handle return value for logging. - write(2, "onSigabrt called\n", 17); + // use unused variable to avoid build warning + ssize_t ret = write(STDERR_FILENO, "onSigabrt called\n", 17); if (checkOnSigabrt) { - write(2, "onSigabrt called again. go to exit\n", 35); + ret = write(STDERR_FILENO, "onSigabrt called again. go to exit\n", 35); + _unused(ret); exit(0); } if (hasException()) { - write(2, "******************************************************\n", 55); - write(2, "Unhandled exception is occured. check application code\n", 55); - write(2, "******************************************************\n", 55); + ret = write(STDERR_FILENO, "******************************************************\n", 55); + ret = write(STDERR_FILENO, "Unhandled exception is occured. check application code\n", 55); + ret = write(STDERR_FILENO, "******************************************************\n", 55); } checkOnSigabrt = true; if (sigaction(SIGABRT, &sig_abrt_old, NULL) == 0) { if (raise(signum) < 0) { - write(2, "Fail to raise SIGABRT\n", 22); + ret = write(STDERR_FILENO, "Fail to raise SIGABRT\n", 22); } } else { - write(2, "Fail to set original SIGABRT handler\n", 37); + ret = write(STDERR_FILENO, "Fail to set original SIGABRT handler\n", 37); } + _unused(ret); } static void registerSigHandler()