summaryrefslogtreecommitdiffstats
path: root/src/state.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-06 16:36:59 +0200
committerDavid Robillard <d@drobilla.net>2020-08-06 21:35:16 +0200
commit1dd3439bb66eae7b61a3ce22b72ae8668fec1b58 (patch)
tree24e954d205a691cae8ba3ccfb3da64a184ea247e /src/state.c
parentdb8a69a52e6dd5c9529537fb1e17489ee883e48c (diff)
downloadlilv-1dd3439bb66eae7b61a3ce22b72ae8668fec1b58.tar.gz
lilv-1dd3439bb66eae7b61a3ce22b72ae8668fec1b58.tar.bz2
lilv-1dd3439bb66eae7b61a3ce22b72ae8668fec1b58.zip
Add lilv_remove()
Diffstat (limited to 'src/state.c')
-rw-r--r--src/state.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/state.c b/src/state.c
index 3086ea6..474ddbe 100644
--- a/src/state.c
+++ b/src/state.c
@@ -30,10 +30,6 @@
#include "lv2/state/state.h"
#include "lv2/urid/urid.h"
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-
#include <assert.h>
#include <errno.h>
#include <stdbool.h>
@@ -1252,7 +1248,7 @@ static void
try_unlink(const char* state_dir, const char* path)
{
if (!strncmp(state_dir, path, strlen(state_dir))) {
- if (lilv_path_exists(path) && unlink(path)) {
+ if (lilv_path_exists(path) && lilv_remove(path)) {
LILV_ERRORF("Failed to remove %s (%s)\n", path, strerror(errno));
}
}
@@ -1329,7 +1325,7 @@ lilv_state_delete(LilvWorld* world,
}
}
- if (rmdir(state->dir)) {
+ if (lilv_remove(state->dir)) {
LILV_ERRORF("Failed to remove directory %s (%s)\n",
state->dir, strerror(errno));
}