mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 09:51:22 +02:00
overload access(2)
Conflicts: src/driver/pictureviewer/pictureviewer.cpp src/gui/components/cc_item_picture.cpp src/gui/movieplayer.cpp src/gui/osdlang_setup.cpp src/neutrino.cpp src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp src/nhttpd/yhttpd.cpp src/system/helpers.h src/system/setting_helpers.cpp
This commit is contained in:
@@ -104,7 +104,7 @@ void CNetworkConfig::init_vars(void)
|
||||
wireless = 0;
|
||||
std::string tmp = "/sys/class/net/" + ifname + "/wireless";
|
||||
|
||||
if(access(tmp.c_str(), R_OK) == 0)
|
||||
if(access(tmp, R_OK) == 0)
|
||||
wireless = 1;
|
||||
if(wireless)
|
||||
readWpaConfig();
|
||||
|
@@ -466,7 +466,8 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data)
|
||||
name = xmlGetAttribute(search, "name");
|
||||
if(g_settings.timezone == name) {
|
||||
zone = xmlGetAttribute(search, "zone");
|
||||
found = true;
|
||||
if (!access("/usr/share/zoneinfo/" + zone, R_OK))
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -69,7 +69,7 @@ bool cYTCache::getNameIfExists(std::string &fname, const std::string &id, int it
|
||||
char ytitag[10];
|
||||
snprintf(ytitag, sizeof(ytitag), "%d", itag);
|
||||
std::string f = g_settings.downloadcache_dir + "/" + id + "-" + std::string(ytitag) + "." + ext;
|
||||
if (access(f.c_str(), R_OK))
|
||||
if (access(f, R_OK))
|
||||
return false;
|
||||
fname = f;
|
||||
return true;
|
||||
@@ -78,10 +78,10 @@ bool cYTCache::getNameIfExists(std::string &fname, const std::string &id, int it
|
||||
bool cYTCache::useCachedCopy(MI_MOVIE_INFO *mi)
|
||||
{
|
||||
std::string file = getName(mi);
|
||||
if (access(file.c_str(), R_OK))
|
||||
if (access(file, R_OK))
|
||||
return false;
|
||||
std::string xml = getName(mi, "xml");
|
||||
if (!access(xml.c_str(), R_OK)) {
|
||||
if (!access(xml, R_OK)) {
|
||||
mi->file.Url = file;
|
||||
return true;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ bool cYTCache::download(MI_MOVIE_INFO *mi)
|
||||
{
|
||||
std::string file = getName(mi);
|
||||
std::string xml = getName(mi, "xml");
|
||||
if (!access(file.c_str(), R_OK) && !access(xml.c_str(), R_OK)) {
|
||||
if (!access(file, R_OK) && !access(xml, R_OK)) {
|
||||
fprintf(stderr, "%s: %s already present and valid\n", __func__, file.c_str());
|
||||
return true;
|
||||
}
|
||||
|
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <OpenThreads/ScopedLock>
|
||||
#include "settings.h"
|
||||
#include "helpers.h"
|
||||
#include "set_threadname.h"
|
||||
#include <global.h>
|
||||
|
||||
@@ -615,7 +616,7 @@ bool cYTFeedParser::DownloadThumbnail(cYTVideoInfo &vinfo, CURL *_curl_handle)
|
||||
bool found = false;
|
||||
if (!vinfo.thumbnail.empty()) {
|
||||
std::string fname = thumbnail_dir + "/" + vinfo.id + ".jpg";
|
||||
found = !access(fname.c_str(), F_OK);
|
||||
found = !access(fname, F_OK);
|
||||
if (!found) {
|
||||
for (int *fmtp = itags; *fmtp && !found; fmtp++)
|
||||
found = cYTCache::getInstance()->getNameIfExists(fname, vinfo.id, *fmtp);
|
||||
|
Reference in New Issue
Block a user