Mailing List archive

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

[vdr] graphtft-0.0.6 patch for vdr-1.3.17 poisoned plugins...



Patch to replace thread unsafe localtime and reordered includes to allow
graphtft-0.0.6 to compile with the poison patches. Not fully tested yet
but it compiles and runs (still running) and I can now use NPTL with the
recent thread patches.

Cheers,

Laz


diff -urN graphtft-0.0.6/common.c graphtft-0.0.6-ts/common.c
--- graphtft-0.0.6/common.c     2004-11-07 20:11:33.000000000 +0000
+++ graphtft-0.0.6-ts/common.c  2004-12-06 13:51:43.826348408 +0000
@@ -41,7 +41,8 @@
     switch (GraphTFTSetup.Logger) {
       case STDOUT : vsnprintf(t + 21, sizeof t - 21, fmt, ap);
                     time(&now);
-                    strftime(t, sizeof t, "[graphTFT: %H:%M:%S]", localtime(&now));
+                    struct tm tmEvent;
+                    strftime(t, sizeof t, "[graphTFT: %H:%M:%S]", localtime_r(&now, &tmEvent));
                     t[20] = ' ';
                     printf("%s\033[K", t);
                     break;
@@ -56,7 +57,8 @@
                     if (lf != (FILE *)NULL) {
                       vsnprintf(t + 20, sizeof t - 20, fmt, ap);
                       time(&now);
-                      strftime(t, sizeof t, "%d.%m.%Y %H:%M:%S", localtime(&now));
+                      struct tm tmEvent;
+                      strftime(t, sizeof t, "%d.%m.%Y %H:%M:%S", localtime_r(&now, &tmEvent));
                       t[19] = ' ';
                       fprintf(lf, "%s\n", t);
                     }
diff -urN graphtft-0.0.6/dfbrenderer/dfbrenderer.c graphtft-0.0.6-ts/dfbrenderer/dfbrenderer.c
--- graphtft-0.0.6/dfbrenderer/dfbrenderer.c    2004-11-07 20:10:49.000000000 +0000
+++ graphtft-0.0.6-ts/dfbrenderer/dfbrenderer.c 2004-12-06 13:40:10.089812392 +0000
@@ -16,11 +16,11 @@

 #include <stdlib.h>

+#include "common.h"
 #include "directfb.h"
 #include "dfbrenderer.h"
 #include "setup.h"
 #include "cache.h"
-#include "common.h"

 static IDirectFB *dfb = NULL;
 static IDirectFBDisplayLayer *primarylayer = NULL;
diff -urN graphtft-0.0.6/imlibrenderer/fbrenderer/mpeg2decoder.c graphtft-0.0.6-ts/imlibrenderer/fbrenderer/mpeg2decoder.c
--- graphtft-0.0.6/imlibrenderer/fbrenderer/mpeg2decoder.c      2004-11-07 20:10:50.000000000 +0000
+++ graphtft-0.0.6-ts/imlibrenderer/fbrenderer/mpeg2decoder.c   2004-12-06 13:38:52.127664440 +0000
@@ -15,10 +15,10 @@
 //The most part of this Code is from the Softdevice Plugin:

 #include <sys/time.h>
+#include "common.h"

 #include <vdr/plugin.h>
 #include "mpeg2decoder.h"
-#include "common.h"

 #define UNSYNCED 0
 #define PAYLOAD 100






Home | Main Index | Thread Index