From 8d7c566d955e027c8d3f5cce312ceebb1ef310dc Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sat, 9 Jan 2010 13:44:10 +0100 Subject: [PATCH] Use m_realpath(path) instead of realpath(path, NULL) --- src/filescanner.c | 5 +++-- src/filescanner_itunes.c | 3 ++- src/filescanner_m3u.c | 3 ++- src/httpd.c | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/filescanner.c b/src/filescanner.c index 3542914d..f2c1bcea 100644 --- a/src/filescanner.c +++ b/src/filescanner.c @@ -45,6 +45,7 @@ #include "db.h" #include "filescanner.h" #include "conffile.h" +#include "misc.h" #define F_SCAN_BULK (1 << 0) @@ -478,7 +479,7 @@ process_directory(int libidx, char *path, int flags) if (S_ISLNK(sb.st_mode)) { - deref = realpath(entry, NULL); + deref = m_realpath(entry); if (!deref) { DPRINTF(E_LOG, L_SCAN, "Skipping %s, could not dereference symlink: %s\n", entry, strerror(errno)); @@ -809,7 +810,7 @@ process_inotify_file(struct watch_info *wi, char *path, struct inotify_event *ie if (S_ISLNK(sb.st_mode)) { - deref = realpath(path, NULL); + deref = m_realpath(path); if (!deref) { DPRINTF(E_LOG, L_SCAN, "Could not dereference symlink '%s': %s\n", path, strerror(errno)); diff --git a/src/filescanner_itunes.c b/src/filescanner_itunes.c index 0cac5183..457d0d51 100644 --- a/src/filescanner_itunes.c +++ b/src/filescanner_itunes.c @@ -39,6 +39,7 @@ #include "db.h" #include "filescanner.h" #include "conffile.h" +#include "misc.h" /* Mapping between iTunes library IDs and our DB IDs */ @@ -280,7 +281,7 @@ find_track_file(char *location, char *base) plen -= 1; /* Try exact path first */ - filename = realpath(location + plen, NULL); + filename = m_realpath(location + plen); if (filename) { mfi_id = db_file_id_bypath(filename); diff --git a/src/filescanner_m3u.c b/src/filescanner_m3u.c index 615467b8..3c9e8b8a 100644 --- a/src/filescanner_m3u.c +++ b/src/filescanner_m3u.c @@ -37,6 +37,7 @@ #include "logger.h" #include "db.h" #include "filescanner.h" +#include "misc.h" void @@ -182,7 +183,7 @@ scan_m3u_playlist(char *file) entry = rel_entry; } - filename = realpath(entry, NULL); + filename = m_realpath(entry); if (!filename) { DPRINTF(E_WARN, L_SCAN, "Could not determine real path for '%s': %s\n", entry, strerror(errno)); diff --git a/src/httpd.c b/src/httpd.c index 723dba6a..2010bdf0 100644 --- a/src/httpd.c +++ b/src/httpd.c @@ -681,7 +681,7 @@ serve_file(struct evhttp_request *req, char *uri) } else if (S_ISLNK(sb.st_mode)) { - deref = realpath(path, NULL); + deref = m_realpath(path); if (!deref) { DPRINTF(E_LOG, L_HTTPD, "Could not dereference %s: %s\n", path, strerror(errno));