Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: problems with editing in 1.3.12



I demand that Torgeir Veimo may or may not have written...

> On Mon, 2004-07-26 at 22:59 +0200, Klaus Schmidinger wrote:
>> Dick Streefland wrote:
[snip]
>>> Sorry to followup my own post, but I just found other reports of this
>>> problem in the list archives. The LD_ASSUME_KERNEL=2.4 workaround fixes
>>> my problem! However, does this workaround have any disadvantages?

>> Don't know of any disadvantages, but VDR 1.3.12 should have stopped right
>> at startup with a message of

>>   vdr: please turn off NPTL by setting 'export LD_ASSUME_KERNEL=2.4.1'
>>   before starting VDR

>> when started on a system with NPTL.

Not here ;-)

>> Didn't it do this on your system?

> It doesn't do this on my 2.6.6 based fc2 system.

Odd. What does this program report?

  #include <stdio.h>
  #include <unistd.h>

  int main (void)
  {
    size_t pth_l = confstr (_CS_GNU_LIBPTHREAD_VERSION, 0, 0);
    char *pth = (char *)malloc (pth_l);
    if (confstr (_CS_GNU_LIBPTHREAD_VERSION, pth, pth_l) > 0)
      printf ("libpthread version is %s\n", pth);
    else
      puts ("no libpthread version information found");
    return 0;
  }

(FWIW, I'm using the attached patch with 1.3.12.)

-- 
| Darren Salt | d youmustbejoking,demon,co,uk | nr. Ashington,
| Debian,     | s zap,tartarus,org            | Northumberland
| RISC OS     | @                             | Toon Army
|   Let's keep the pound sterling

Don't diddle code to make it faster - find a better algorithm.
diff -urNad vdr-1.3.11.orig/vdr.c vdr-1.3.11/vdr.c
--- vdr-1.3.11.orig/vdr.c	2004-06-19 15:42:31.000000000 +0100
+++ vdr-1.3.11/vdr.c	2004-06-19 15:45:14.000000000 +0100
@@ -25,12 +25,12 @@
  * $Id: vdr.c 1.184 2004/06/13 13:52:09 kls Exp $
  */
 
+#include <unistd.h>
 #include <getopt.h>
 #include <locale.h>
 #include <signal.h>
 #include <stdlib.h>
 #include <termios.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include "audio.h"
 #include "channels.h"
@@ -85,16 +85,22 @@
 
 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\n");
-        return 2;
-        }
-     }
-#endif
+  // Check for NPTL and re-exec if present - VDR apparently doesn't run well with NPTL:
+  {
+    size_t pth_l = confstr (_CS_GNU_LIBPTHREAD_VERSION, 0, 0);
+    char *pth = (char *)malloc (pth_l);  
+    if (confstr (_CS_GNU_LIBPTHREAD_VERSION, pth, pth_l) > 0)
+    {
+      if (strstr (pth, "NPTL"))
+      {
+	setenv ("LD_ASSUME_KERNEL", "2.4.21", 1);
+	execve ("/proc/self/exe", argv, environ);
+	fprintf (stderr, "%s: couldn't reload myself: %s\n", argv[0], strerror (errno));
+	return 2;
+      }
+    }
+    free (pth);
+  }
 
   // Check for UTF-8 and exit if present - asprintf() will fail if it encounters 8 bit ASCII codes
   char *LangEnv;

Home | Main Index | Thread Index