#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 */
/* 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;
/* 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;
}