Use m_realpath(path) instead of realpath(path, NULL)

This commit is contained in:
Julien BLACHE 2010-01-09 13:44:10 +01:00
parent b9d8a5880a
commit 8d7c566d95
4 changed files with 8 additions and 5 deletions

View File

@ -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));

View File

@ -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);

View File

@ -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));

View File

@ -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));