mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-14 00:10:10 -04:00
Use m_realpath(path) instead of realpath(path, NULL)
This commit is contained in:
parent
b9d8a5880a
commit
8d7c566d95
@ -45,6 +45,7 @@
|
|||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "filescanner.h"
|
#include "filescanner.h"
|
||||||
#include "conffile.h"
|
#include "conffile.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
#define F_SCAN_BULK (1 << 0)
|
#define F_SCAN_BULK (1 << 0)
|
||||||
@ -478,7 +479,7 @@ process_directory(int libidx, char *path, int flags)
|
|||||||
|
|
||||||
if (S_ISLNK(sb.st_mode))
|
if (S_ISLNK(sb.st_mode))
|
||||||
{
|
{
|
||||||
deref = realpath(entry, NULL);
|
deref = m_realpath(entry);
|
||||||
if (!deref)
|
if (!deref)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_SCAN, "Skipping %s, could not dereference symlink: %s\n", entry, strerror(errno));
|
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))
|
if (S_ISLNK(sb.st_mode))
|
||||||
{
|
{
|
||||||
deref = realpath(path, NULL);
|
deref = m_realpath(path);
|
||||||
if (!deref)
|
if (!deref)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_SCAN, "Could not dereference symlink '%s': %s\n", path, strerror(errno));
|
DPRINTF(E_LOG, L_SCAN, "Could not dereference symlink '%s': %s\n", path, strerror(errno));
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "filescanner.h"
|
#include "filescanner.h"
|
||||||
#include "conffile.h"
|
#include "conffile.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
/* Mapping between iTunes library IDs and our DB IDs */
|
/* Mapping between iTunes library IDs and our DB IDs */
|
||||||
@ -280,7 +281,7 @@ find_track_file(char *location, char *base)
|
|||||||
plen -= 1;
|
plen -= 1;
|
||||||
|
|
||||||
/* Try exact path first */
|
/* Try exact path first */
|
||||||
filename = realpath(location + plen, NULL);
|
filename = m_realpath(location + plen);
|
||||||
if (filename)
|
if (filename)
|
||||||
{
|
{
|
||||||
mfi_id = db_file_id_bypath(filename);
|
mfi_id = db_file_id_bypath(filename);
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "filescanner.h"
|
#include "filescanner.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -182,7 +183,7 @@ scan_m3u_playlist(char *file)
|
|||||||
entry = rel_entry;
|
entry = rel_entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = realpath(entry, NULL);
|
filename = m_realpath(entry);
|
||||||
if (!filename)
|
if (!filename)
|
||||||
{
|
{
|
||||||
DPRINTF(E_WARN, L_SCAN, "Could not determine real path for '%s': %s\n", entry, strerror(errno));
|
DPRINTF(E_WARN, L_SCAN, "Could not determine real path for '%s': %s\n", entry, strerror(errno));
|
||||||
|
@ -681,7 +681,7 @@ serve_file(struct evhttp_request *req, char *uri)
|
|||||||
}
|
}
|
||||||
else if (S_ISLNK(sb.st_mode))
|
else if (S_ISLNK(sb.st_mode))
|
||||||
{
|
{
|
||||||
deref = realpath(path, NULL);
|
deref = m_realpath(path);
|
||||||
if (!deref)
|
if (!deref)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_HTTPD, "Could not dereference %s: %s\n", path, strerror(errno));
|
DPRINTF(E_LOG, L_HTTPD, "Could not dereference %s: %s\n", path, strerror(errno));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user