aboutsummaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-02 17:22:56 +0100
committerMax Kellermann <max@duempel.org>2009-01-02 17:22:56 +0100
commit38fb8a01c1721ab9aefe8a38e8e8d220cf6cf447 (patch)
treecdf2baf9c1721b45239caee011c1483e4c9d4957 /src/update.c
parent4b6d17a670138227cdd23df2d414c184cb84a41f (diff)
downloadmpd-38fb8a01c1721ab9aefe8a38e8e8d220cf6cf447.tar.gz
mpd-38fb8a01c1721ab9aefe8a38e8e8d220cf6cf447.tar.xz
mpd-38fb8a01c1721ab9aefe8a38e8e8d220cf6cf447.zip
update: use GLib instead of utils.h
Diffstat (limited to 'src/update.c')
-rw-r--r--src/update.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/update.c b/src/update.c
index 79db6ee43..ae407f157 100644
--- a/src/update.c
+++ b/src/update.c
@@ -25,7 +25,6 @@
#include "mapper.h"
#include "path.h"
#include "playlist.h"
-#include "utils.h"
#include "event_pipe.h"
#include "condition.h"
#include "update.h"
@@ -40,6 +39,8 @@
#include <unistd.h>
#include <dirent.h>
#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "update"
@@ -559,7 +560,7 @@ static struct directory *
addParentPathToDB(const char *utf8path)
{
struct directory *directory = db_get_root();
- char *duplicated = xstrdup(utf8path);
+ char *duplicated = g_strdup(utf8path);
char *slash = duplicated;
while ((slash = strchr(slash, '/')) != NULL) {
@@ -641,13 +642,13 @@ directory_update_init(char *path)
if (progress != UPDATE_PROGRESS_IDLE) {
unsigned next_task_id;
- if (update_paths_nr == ARRAY_SIZE(update_paths)) {
+ if (update_paths_nr == G_N_ELEMENTS(update_paths)) {
if (path)
free(path);
return 0;
}
- assert(update_paths_nr < ARRAY_SIZE(update_paths));
+ assert(update_paths_nr < G_N_ELEMENTS(update_paths));
update_paths[update_paths_nr++] = path;
next_task_id = update_task_id + update_paths_nr;