Change-Id: I8b72cd6702def0a57d5ce570cb183d90f43519f6
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
#include "server.h"
#include <unistd.h>
+#include <sys/stat.h>
#include <systemd/sd-daemon.h>
#include <sensor_log.h>
#include <command_types.h>
static void set_cal_data(const char *path)
{
+ struct stat file_stat;
+
+ if (lstat(path, &file_stat) != 0)
+ return;
+
+ if (!S_ISREG(file_stat.st_mode))
+ return;
+
FILE *fp = fopen(path, "w");
retm_if(!fp, "There is no calibration file[%s]", path);