Fix mm_sound_testsuite input error and remove focus client warnings remained 56/44956/8 accepted/tizen/mobile/20150730.121859 accepted/tizen/tv/20150730.122021 accepted/tizen/wearable/20150730.122138 submit/tizen/20150730.073716
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 30 Jul 2015 05:42:08 +0000 (14:42 +0900)
committerinhyeok <i_bc.kim@samsung.com>
Thu, 30 Jul 2015 07:31:28 +0000 (16:31 +0900)
[Version] Release 0.9.248
[Profile] Common
[Issue Type] Bug Fix

Change-Id: I8514b6783f896381b4ef426084ba674041f1f61f
Signed-off-by: Seungbae Shin <seungbae.shin@samsung.com>
mm_sound_focus.c
testsuite/mm_sound_testsuite_simple.c

index 2bbff1f..896aaef 100644 (file)
@@ -27,6 +27,7 @@
 #include <mm_debug.h>
 
 #include "include/mm_sound.h"
+#include "include/mm_sound_client.h"
 #include "include/mm_sound_focus.h"
 #include "focus_server/include/mm_sound_mgr_focus.h"
 
index 5c2e691..abccaaf 100755 (executable)
@@ -320,14 +320,16 @@ gboolean timeout_quit_program(void* data)
 gboolean input (GIOChannel *channel)
 {
        GError *err = NULL;
-       gsize read;
-       char buf[MAX_STRING_LEN + 3];
+       gchar *buf = NULL;
+       gsize length = 0;
 
-       g_io_channel_read_chars(channel, buf, MAX_STRING_LEN, &read, &err);
-       buf[read] = '\0';
-       g_strstrip(buf);
-
-       interpret (buf);
+       if (g_io_channel_read_line(channel, &buf, &length, NULL, &err) == G_IO_STATUS_NORMAL) {
+               if (length > 1) {
+                       g_strstrip(buf);
+                       interpret(buf);
+               }
+               g_free(buf);
+       }
 
        return TRUE;
 }