fvisibility=hidden is applied and API's return value is checked
authorSeungyoun Ju <sy39.ju@samsung.com>
Tue, 12 Feb 2013 03:11:01 +0000 (12:11 +0900)
committerSeungyoun Ju <sy39.ju@samsung.com>
Tue, 12 Feb 2013 07:16:48 +0000 (16:16 +0900)
- Issues
  Unnecessary symbols should be hided.
  There is the API's return value which is not checked.

- Fix description
  Build option is changed.
  API's return value is checked.

Change-Id: I01be7c806ca7d7b4e161c3daad0790729a26b5b7

CMakeLists.txt
test/tethering_test.c

index 187d1b3..75bd74e 100644 (file)
@@ -27,7 +27,7 @@ ENDIF("${ARCH}" STREQUAL "arm")
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=%{_libdir}")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=%{_libdir} -fvisibility=hidden")
 
 FIND_PROGRAM(MARSHALTOOL NAMES glib-genmarshal)
 EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${INC_DIR}/marshal.list --header > ${INC_DIR}/marshal.h")
index 59674f8..026400b 100644 (file)
@@ -560,12 +560,17 @@ gboolean input(GIOChannel *channel, GIOCondition condition, gpointer data)
        }
 #else
        GError *err = NULL;
+       GIOStatus ios;
 
-       g_io_channel_read_chars(channel, buf, INPUT_BUF_LEN, &read, &err);
+       ios = g_io_channel_read_chars(channel, buf, INPUT_BUF_LEN, &read, &err);
        if (err != NULL) {
-               g_print("g_io_channel_read is failed : %s\n", err->message);
+               g_print("g_io_channel_read_chars is failed : %s\n",
+                               err->message);
                g_error_free(err);
                return FALSE;
+       } else if (ios != G_IO_STATUS_NORMAL) {
+               g_print("g_io_channel_read_chars is failed : %d\n", ios);
+               return FALSE;
        }
 #endif