Merge "tizen: Add additional unit for "unified" user session" into tizen
authorJongmin Lee <jm105.lee@samsung.com>
Thu, 2 May 2019 06:43:03 +0000 (06:43 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 2 May 2019 06:43:03 +0000 (06:43 +0000)
bus/at-spi-bus-launcher.c

index e42a26d..65bb0b1 100644 (file)
@@ -349,7 +349,11 @@ ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path)
   argv[1] = (char*)config_path;
 
   if (pipe (app->pipefd) < 0)
-    g_error ("Failed to create pipe: %s", strerror (errno));
+    {
+      char buf[4096] = { 0 };
+      strerror_r (errno, buf, sizeof(buf));
+      g_error ("Failed to create pipe: %s", buf);
+    }
 
   g_clear_pointer (&app->a11y_launch_error_message, g_free);
 
@@ -378,7 +382,9 @@ ensure_a11y_bus_daemon (A11yBusLauncher *app, char *config_path)
   LOGD("Launched a11y bus, child is %ld", (long) pid);
   if (!unix_read_all_fd_to_string (app->pipefd[0], addr_buf, sizeof (addr_buf)))
     {
-      app->a11y_launch_error_message = g_strdup_printf ("Failed to read address: %s", strerror (errno));
+      char buf[4096] = { 0 };
+      strerror_r (errno, buf, sizeof(buf));
+      app->a11y_launch_error_message = g_strdup_printf ("Failed to read address: %s", buf);
       kill (app->a11y_bus_pid, SIGTERM);
       goto error;
     }
@@ -437,16 +443,32 @@ ensure_a11y_bus_broker (A11yBusLauncher *app, char *config_path)
   GError *error = NULL;
 
   if ((app->listenfd = socket (PF_UNIX, SOCK_STREAM | SOCK_NONBLOCK, 0)) < 0)
-    g_error ("Failed to create listening socket: %s", strerror (errno));
+    {
+      char buf[4096] = { 0 };
+      strerror_r (errno, buf, sizeof(buf));
+      g_error ("Failed to create listening socket: %s", buf);
+    }
 
   if (bind (app->listenfd, (struct sockaddr *)&addr, sizeof(sa_family_t)) < 0)
-    g_error ("Failed to bind listening socket: %s", strerror (errno));
+    {
+      char buf[4096] = { 0 };
+      strerror_r (errno, buf, sizeof(buf));
+      g_error ("Failed to bind listening socket: %s", buf);
+    }
 
   if (getsockname (app->listenfd, (struct sockaddr *)&addr, &addr_len) < 0)
-    g_error ("Failed to get socket name for listening socket: %s", strerror(errno));
+    {
+      char buf[4096] = { 0 };
+      strerror_r (errno, buf, sizeof(buf));
+      g_error ("Failed to get socket name for listening socket: %s", buf);
+    }
 
   if (listen (app->listenfd, 1024) < 0)
-    g_error ("Failed to listen on socket: %s", strerror(errno));
+    {
+      char buf[4096] = { 0 };
+      strerror_r (errno, buf, sizeof(buf));
+      g_error ("Failed to listen on socket: %s", buf);
+    }
 
   g_clear_pointer (&app->a11y_launch_error_message, g_free);
 
@@ -870,7 +892,11 @@ init_sigterm_handling (A11yBusLauncher *app)
   GIOChannel *sigterm_channel;
 
   if (pipe (sigterm_pipefd) < 0)
-    g_error ("Failed to create pipe: %s", strerror (errno));
+    {
+      char buf[4096] = { 0 };
+      strerror_r (errno, buf, sizeof(buf));
+      g_error ("Failed to create pipe: %s", buf);
+    }
   signal (SIGTERM, sigterm_handler);
 
   sigterm_channel = g_io_channel_unix_new (sigterm_pipefd[0]);