Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 713086 | Differences between
and this patch

Collapse All | Expand All

(-)a/i18n.h (-1 / +1 lines)
Lines 46-52 const cStringList *I18nLanguages(void); Link Here
46
   ///< have an actual locale installed. The rest are just dummy entries
46
   ///< have an actual locale installed. The rest are just dummy entries
47
   ///< to allow having three letter language codes for other languages
47
   ///< to allow having three letter language codes for other languages
48
   ///< that have no actual locale on this system.
48
   ///< that have no actual locale on this system.
49
const char *I18nTranslate(const char *s, const char *Plugin = NULL) __attribute_format_arg__(1);
49
const char *I18nTranslate(const char *s, const char *Plugin = NULL)  __attribute__((__format_arg__ (1)));
50
   ///< Translates the given string (with optional Plugin context) into
50
   ///< Translates the given string (with optional Plugin context) into
51
   ///< the current language. If no translation is available, the original
51
   ///< the current language. If no translation is available, the original
52
   ///< string will be returned.
52
   ///< string will be returned.
(-)a/osd.c (-1 / +1 lines)
Lines 12-18 Link Here
12
#include <stdlib.h>
12
#include <stdlib.h>
13
#include <sys/ioctl.h>
13
#include <sys/ioctl.h>
14
#include <sys/stat.h>
14
#include <sys/stat.h>
15
#include <sys/unistd.h>
15
#include <unistd.h>
16
#include "device.h"
16
#include "device.h"
17
#include "tools.h"
17
#include "tools.h"
18
18
(-)a/thread.c (-1 / +3 lines)
Lines 155-161 cRwLock::cRwLock(bool PreferWriter) Link Here
155
  writeLockThreadId = 0;
155
  writeLockThreadId = 0;
156
  pthread_rwlockattr_t attr;
156
  pthread_rwlockattr_t attr;
157
  pthread_rwlockattr_init(&attr);
157
  pthread_rwlockattr_init(&attr);
158
#if defined(__GLIBC__)
158
  pthread_rwlockattr_setkind_np(&attr, PreferWriter ? PTHREAD_RWLOCK_PREFER_WRITER_NP : PTHREAD_RWLOCK_PREFER_READER_NP);
159
  pthread_rwlockattr_setkind_np(&attr, PreferWriter ? PTHREAD_RWLOCK_PREFER_WRITER_NP : PTHREAD_RWLOCK_PREFER_READER_NP);
160
#endif
159
  pthread_rwlock_init(&rwlock, &attr);
161
  pthread_rwlock_init(&rwlock, &attr);
160
}
162
}
161
163
Lines 205-211 cMutex::cMutex(void) Link Here
205
  locked = 0;
207
  locked = 0;
206
  pthread_mutexattr_t attr;
208
  pthread_mutexattr_t attr;
207
  pthread_mutexattr_init(&attr);
209
  pthread_mutexattr_init(&attr);
208
  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
210
  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
209
  pthread_mutex_init(&mutex, &attr);
211
  pthread_mutex_init(&mutex, &attr);
210
}
212
}
211
213
(-)a/tools.c (-2 / +2 lines)
Lines 640-646 char *ReadLink(const char *FileName) Link Here
640
{
640
{
641
  if (!FileName)
641
  if (!FileName)
642
     return NULL;
642
     return NULL;
643
  char *TargetName = canonicalize_file_name(FileName);
643
  char *TargetName = realpath(FileName, NULL);
644
  if (!TargetName) {
644
  if (!TargetName) {
645
     if (errno == ENOENT) // file doesn't exist
645
     if (errno == ENOENT) // file doesn't exist
646
        TargetName = strdup(FileName);
646
        TargetName = strdup(FileName);
Lines 1528-1534 Link Here
1528
struct dirent *cReadDir::Next(void)
1528
struct dirent *cReadDir::Next(void)
1529
{
1529
{
1530
  if (directory) {
1530
  if (directory) {
1531
#if !__GLIBC_PREREQ(2, 24) // readdir_r() is deprecated as of GLIBC 2.24
1531
#if __GLIBC__
1532
     while (readdir_r(directory, &u.d, &result) == 0 && result) {
1532
     while (readdir_r(directory, &u.d, &result) == 0 && result) {
1533
#else
1533
#else
1534
     while ((result = readdir(directory)) != NULL) {
1534
     while ((result = readdir(directory)) != NULL) {
(-)a/tools.h (-2 / +12 lines)
Lines 28-33 Link Here
28
#include <sys/types.h>
28
#include <sys/types.h>
29
#include "thread.h"
29
#include "thread.h"
30
30
31
#ifndef ACCESSPERMS
32
# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
33
#endif
34
#ifndef ALLPERMS
35
# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
36
#endif
37
#ifndef DEFFILEMODE
38
# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
39
#endif
40
31
typedef unsigned char uchar;
41
typedef unsigned char uchar;
32
42
33
extern int SysLogLevel;
43
extern int SysLogLevel;
Lines 400-406 Link Here
400
private:
410
private:
401
  DIR *directory;
411
  DIR *directory;
402
  struct dirent *result;
412
  struct dirent *result;
403
#if !__GLIBC_PREREQ(2, 24) // readdir_r() is deprecated as of GLIBC 2.24
413
#if __GLIBC__
404
  union { // according to "The GNU C Library Reference Manual"
414
  union { // according to "The GNU C Library Reference Manual"
405
    struct dirent d;
415
    struct dirent d;
406
    char b[offsetof(struct dirent, d_name) + NAME_MAX + 1];
416
    char b[offsetof(struct dirent, d_name) + NAME_MAX + 1];
Lines 738-744 public: Link Here
738
        data[i] = T(0);
748
        data[i] = T(0);
739
    size = 0;
749
    size = 0;
740
  }
750
  }
741
  void Sort(__compar_fn_t Compare)
751
  void Sort(int (*Compare)(const void *, const void *))
742
  {
752
  {
743
    qsort(data, size, sizeof(T), Compare);
753
    qsort(data, size, sizeof(T), Compare);
744
  }
754
  }
(-)a/vdr.c (+6 lines)
Lines 670-681 int main(int argc, char *argv[]) Link Here
670
        }
670
        }
671
     }
671
     }
672
  else if (Terminal) {
672
  else if (Terminal) {
673
#ifdef __GLIBC__
673
     // Claim new controlling terminal
674
     // Claim new controlling terminal
674
     stdin  = freopen(Terminal, "r", stdin);
675
     stdin  = freopen(Terminal, "r", stdin);
675
     stdout = freopen(Terminal, "w", stdout);
676
     stdout = freopen(Terminal, "w", stdout);
676
     stderr = freopen(Terminal, "w", stderr);
677
     stderr = freopen(Terminal, "w", stderr);
677
     HasStdin = true;
678
     HasStdin = true;
678
     tcgetattr(STDIN_FILENO, &savedTm);
679
     tcgetattr(STDIN_FILENO, &savedTm);
680
#else
681
     // stdin, stdout, stderr are declared FILE const* by musl C library
682
     fprintf(stderr, "Option '-t' is only supported if VDR has been built against glibc.\n");
683
     return 2;
684
#endif
679
     }
685
     }
680
686
681
  isyslog("VDR version %s started", VDRVERSION);
687
  isyslog("VDR version %s started", VDRVERSION);

Return to bug 713086