Mailing List archive

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

[vdr] Re: Brain-dead file systems.



Habib Azimi wrote:
> 
> Hi Carsten,
> 
> I´Ve tested your code modification but while compiling I get an error
> and the GCC stop work:

I apologize.
Here is what I mean in the form of a real patch 
that at least compiles without problems here:

--- recording.c.orig    Fri Jul  5 20:01:35 2002
+++ recording.c Fri Jul  5 20:02:58 2002
@@ -21,12 +21,15 @@
 
 #define RECEXT       ".rec"
 #define DELEXT       ".del"
+
+#define DATAFORMAT_VFAT   "%4d-%02d-%02d.%02d.%02d.%02d.%02d" RECEXT
+#define DATAFORMAT_NORMAL   "%4d-%02d-%02d.%02d:%02d.%02d.%02d" RECEXT
+
 #ifdef VFAT
-#define DATAFORMAT   "%4d-%02d-%02d.%02d.%02d.%02d.%02d" RECEXT
+#define NAMEFORMAT   "%s/%s/" DATAFORMAT_VFAT
 #else
-#define DATAFORMAT   "%4d-%02d-%02d.%02d:%02d.%02d.%02d" RECEXT
+#define NAMEFORMAT   "%s/%s/" DATAFORMAT_NORMAL
 #endif
-#define NAMEFORMAT   "%s/%s/" DATAFORMAT
 
 #define RESUMEFILESUFFIX  "/resume.vdr"
 #define SUMMARYFILESUFFIX "/summary.vdr"
@@ -344,7 +347,8 @@
      struct tm tm_r;
      struct tm t = *localtime_r(&now, &tm_r); // this initializes the time zone in 't'
      t.tm_isdst = -1; // makes sure mktime() will determine the correct DST setting
-     if (7 == sscanf(p + 1, DATAFORMAT, &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &priority, &lifetime)) {
+     if ((7 == sscanf(p + 1, DATAFORMAT_NORMAL, &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &priority, &lifetime)) ||
+         (7 == sscanf(p + 1, DATAFORMAT_VFAT, &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &priority, &lifetime))) {
         t.tm_year -= 1900;
         t.tm_mon--;
         t.tm_sec = 0;



Carsten.




Home | Main Index | Thread Index