Move volume vconf set to pulseaudio
[platform/core/multimedia/libmm-sound.git] / mm_sound_bootsound.c
index 51027a9..0f5a129 100644 (file)
 #include <memory.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <stdio.h>
-#include <sys/types.h>
 #include <fcntl.h>
 #include <vconf.h>
 
-#include <sys/stat.h>
-#include <errno.h>
-
 #include <semaphore.h>
-#include <errno.h>
 
-#include <mm_types.h>
 #include <mm_error.h>
-#include <mm_message.h>
 #include <mm_debug.h>
-#include <mm_sound.h>
-#include <mm_sound_private.h>
 
 #define KEYTONE_PATH        "/tmp/keytone"  /* Keytone pipe path */
 #define FILE_FULL_PATH 1024                            /* File path lenth */
@@ -113,7 +103,9 @@ int mm_sound_boot_play_sound(char* path)
        /* Check whether file exists */
        fd = open(path, O_RDONLY);
        if (fd == -1) {
-               debug_error("file open failed with [%s][%d]\n", strerror(errno), errno);
+               char str_error[256];
+               strerror_r(errno, str_error, sizeof(str_error));
+               debug_error("file open failed with [%s][%d]\n", str_error, errno);
                switch (errno) {
                case ENOENT:
                        return MM_ERROR_SOUND_FILE_NOT_FOUND;
@@ -141,7 +133,9 @@ int mm_sound_boot_play_sound(char* path)
        /* Write to PIPE */
        err = write(fd, &data, size);
        if (err < 0) {
-               debug_error("Fail to write data: [%s][%d]\n", strerror(errno), errno);
+               char str_error[256];
+               strerror_r(errno, str_error, sizeof(str_error));
+               debug_error("Fail to write data: [%s][%d]\n", str_error, errno);
                close(fd);
                return MM_ERROR_SOUND_INTERNAL;
        }