mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-29 00:23:23 -05:00
[library] Remove needless stat() in scan_playlist()
Fixes time-of-check time-of-use warning from CodeQL
This commit is contained in:
parent
54faa11ce5
commit
de7ab1547f
@ -414,7 +414,6 @@ scan_playlist(const char *file, time_t mtime, int dir_id)
|
|||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
struct media_file_info mfi;
|
struct media_file_info mfi;
|
||||||
struct stat sb;
|
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
char *path;
|
char *path;
|
||||||
size_t len;
|
size_t len;
|
||||||
@ -433,13 +432,6 @@ scan_playlist(const char *file, time_t mtime, int dir_id)
|
|||||||
if (pl_id < 0)
|
if (pl_id < 0)
|
||||||
return; // Not necessarily an error, could also be that the playlist hasn't changed
|
return; // Not necessarily an error, could also be that the playlist hasn't changed
|
||||||
|
|
||||||
ret = stat(file, &sb);
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
DPRINTF(E_LOG, L_SCAN, "Could not stat() '%s': %s\n", file, strerror(errno));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fp = fopen(file, "r");
|
fp = fopen(file, "r");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user