emulator: improve error handling 07/18507/1
authorKitae Kim <kt920.kim@samsung.com>
Mon, 10 Feb 2014 02:29:21 +0000 (11:29 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Tue, 25 Mar 2014 02:18:54 +0000 (11:18 +0900)
 - check return value and write an error message.

Change-Id: Ic92635ac19825dd2eb3899f15cf3f3da5a923f13
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
tizen/src/emulator.c

index c909418..af0f097 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Emulator
  *
- * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * SeokYeon Hwang <syeon.hwang@samsung.com>
@@ -238,7 +238,9 @@ static void set_image_and_log_path(char *qemu_argv)
     }
 #else
     if (access(log_path, R_OK) != 0) {
-        g_mkdir(log_path, 0755);
+        if (g_mkdir(log_path, 0755) < 0) {
+            fprintf(stderr, "failed to create log directory %s\n", log_path);
+        }
     }
 #endif
     strcat(log_path, LOGFILE);