assgin return value to unused variable to avoid build warning message accepted/tizen/5.0/unified/20181106.070329 accepted/tizen/5.0/unified/20181106.202014 accepted/tizen/unified/20181010.061750 submit/tizen/20181010.001114 submit/tizen_5.0/20181101.000003 submit/tizen_5.0/20181105.120810 submit/tizen_5.0/20181106.000001
authorWoongsuk Cho <ws77.cho@samsung.com>
Thu, 4 Oct 2018 23:11:31 +0000 (08:11 +0900)
committer조웅석/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <ws77.cho@samsung.com>
Tue, 9 Oct 2018 21:35:35 +0000 (06:35 +0900)
NativeLauncher/launcher/dotnet/dotnet_launcher.cc

index 9757464..c7e28e8 100644 (file)
@@ -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()