Checking for NPTL at program start

This commit is contained in:
Klaus Schmidinger 2004-06-10 13:22:08 +02:00
parent def0c7aaa0
commit 3e72d0cc0b
3 changed files with 21 additions and 4 deletions

View File

@ -2892,3 +2892,9 @@ Video Disk Recorder Revision History
- Modified 'libsi' to require callers to state the buffer sizes when getting
strings in order to avoid buffer overflows (thanks to Philip Lawatsch for
debugging a buffer overflow in eit.c).
2004-06-10: Version 1.3.11
- In order to avoid problems on NPTL systems, VDR now checks for the presence
of NPTL at program start, and if it is, exists and tells the user to do
'export LD_ASSUME_KERNEL=2.4.1' before starting VDR.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.197 2004/06/05 10:06:50 kls Exp $
* $Id: config.h 1.198 2004/06/10 13:18:50 kls Exp $
*/
#ifndef __CONFIG_H
@ -20,8 +20,8 @@
#include "i18n.h"
#include "tools.h"
#define VDRVERSION "1.3.10"
#define VDRVERSNUM 10310 // Version * 10000 + Major * 100 + Minor
#define VDRVERSION "1.3.11"
#define VDRVERSNUM 10311 // Version * 10000 + Major * 100 + Minor
#define MAXPRIORITY 99
#define MAXLIFETIME 99

13
vdr.c
View File

@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
* $Id: vdr.c 1.181 2004/05/16 10:12:43 kls Exp $
* $Id: vdr.c 1.182 2004/06/10 13:22:08 kls Exp $
*/
#include <getopt.h>
@ -84,6 +84,17 @@ static void Watchdog(int signum)
int main(int argc, char *argv[])
{
#ifdef _CS_GNU_LIBPTHREAD_VERSION
// Check for NPTL and exit if present - VDR apparently doesn't run well with NPTL:
char LibPthreadVersion[128];
if (confstr(_CS_GNU_LIBPTHREAD_VERSION, LibPthreadVersion, sizeof(LibPthreadVersion) > 0)) {
if (strstr(LibPthreadVersion, "NPTL")) {
fprintf(stderr, "vdr: please turn off NPTL by setting 'export LD_ASSUME_KERNEL=2.4.1' before starting VDR");
return 2;
}
}
#endif
// Save terminal settings:
struct termios savedTm;