summaryrefslogtreecommitdiff
path: root/src/console/logstorage/dlt-logstorage-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/console/logstorage/dlt-logstorage-common.c')
-rw-r--r--src/console/logstorage/dlt-logstorage-common.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/console/logstorage/dlt-logstorage-common.c b/src/console/logstorage/dlt-logstorage-common.c
index a2f60a0..592da25 100644
--- a/src/console/logstorage/dlt-logstorage-common.c
+++ b/src/console/logstorage/dlt-logstorage-common.c
@@ -58,6 +58,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -234,6 +235,28 @@ int dlt_logstorage_check_config_file(char *mnt_point)
return ret;
}
+/** @brief Check if given mount point is writable
+ *
+ * @param mnt_point The mount point to check
+ *
+ * @return 1 if the file is writable, 0 otherwise.
+ */
+int dlt_logstorage_check_directory_permission(char *mnt_point)
+{
+ if (mnt_point == NULL)
+ {
+ pr_error("Given mount point is NULL\n");
+ return 0;
+ }
+
+ if (access(mnt_point, W_OK) == 0)
+ {
+ return 1;
+ }
+
+ return 0;
+}
+
/** @brief Prepares the body of the message to be send to DLT
*
* @param body A pointer to the MsgBody structure pointer