mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Now using readdir() instead of readdir_r(), if GLIBC version 2.24 or newer is used
This commit is contained in:
parent
ce5e23f209
commit
027ae738a8
@ -3037,6 +3037,8 @@ Frank Neumann <fnu@yavdr.org>
|
|||||||
for reporting a problem with the default return value of cEpgHandler::BeginSegmentTransfer()
|
for reporting a problem with the default return value of cEpgHandler::BeginSegmentTransfer()
|
||||||
in derived classes that don't implement this function
|
in derived classes that don't implement this function
|
||||||
for reporting uninitialized variable SdWatchdog in vdr.c
|
for reporting uninitialized variable SdWatchdog in vdr.c
|
||||||
|
for suggesting to use readdir() instead of readdir_r(), if GLIBC version 2.24 or
|
||||||
|
newer is used
|
||||||
|
|
||||||
Gerald Dachs <vdr@dachsweb.de>
|
Gerald Dachs <vdr@dachsweb.de>
|
||||||
for reporting a problem with checking for minimum line length of 21 characters in
|
for reporting a problem with checking for minimum line length of 21 characters in
|
||||||
|
2
HISTORY
2
HISTORY
@ -9152,3 +9152,5 @@ Video Disk Recorder Revision History
|
|||||||
The old version of cSkinDisplayMenu::SetItemEvent() (without the TimerActive parameter)
|
The old version of cSkinDisplayMenu::SetItemEvent() (without the TimerActive parameter)
|
||||||
is still there for backwards compatibility. It may be removed in a future version,
|
is still there for backwards compatibility. It may be removed in a future version,
|
||||||
so plugin authors should switch to the new one.
|
so plugin authors should switch to the new one.
|
||||||
|
- Now using readdir() instead of readdir_r(), if GLIBC version 2.24 or newer is used
|
||||||
|
(suggested by Frank Neumann).
|
||||||
|
6
tools.c
6
tools.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: tools.c 4.7 2017/06/23 09:39:45 kls Exp $
|
* $Id: tools.c 4.8 2017/06/25 11:45:39 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
@ -1528,7 +1528,11 @@ cReadDir::~cReadDir()
|
|||||||
struct dirent *cReadDir::Next(void)
|
struct dirent *cReadDir::Next(void)
|
||||||
{
|
{
|
||||||
if (directory) {
|
if (directory) {
|
||||||
|
#if !__GLIBC_PREREQ(2, 24) // readdir_r() is deprecated as of GLIBC 2.24
|
||||||
while (readdir_r(directory, &u.d, &result) == 0 && result) {
|
while (readdir_r(directory, &u.d, &result) == 0 && result) {
|
||||||
|
#else
|
||||||
|
while ((result = readdir(directory)) != NULL) {
|
||||||
|
#endif
|
||||||
if (strcmp(result->d_name, ".") && strcmp(result->d_name, ".."))
|
if (strcmp(result->d_name, ".") && strcmp(result->d_name, ".."))
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
4
tools.h
4
tools.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: tools.h 4.12 2017/06/11 10:00:49 kls Exp $
|
* $Id: tools.h 4.13 2017/06/25 11:45:38 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __TOOLS_H
|
#ifndef __TOOLS_H
|
||||||
@ -400,10 +400,12 @@ class cReadDir {
|
|||||||
private:
|
private:
|
||||||
DIR *directory;
|
DIR *directory;
|
||||||
struct dirent *result;
|
struct dirent *result;
|
||||||
|
#if !__GLIBC_PREREQ(2, 24) // readdir_r() is deprecated as of GLIBC 2.24
|
||||||
union { // according to "The GNU C Library Reference Manual"
|
union { // according to "The GNU C Library Reference Manual"
|
||||||
struct dirent d;
|
struct dirent d;
|
||||||
char b[offsetof(struct dirent, d_name) + NAME_MAX + 1];
|
char b[offsetof(struct dirent, d_name) + NAME_MAX + 1];
|
||||||
} u;
|
} u;
|
||||||
|
#endif
|
||||||
public:
|
public:
|
||||||
cReadDir(const char *Directory);
|
cReadDir(const char *Directory);
|
||||||
~cReadDir();
|
~cReadDir();
|
||||||
|
Loading…
Reference in New Issue
Block a user