Changeset 208 for SH_SHM/trunk


Ignore:
Timestamp:
04/19/2010 02:53:32 PM (14 years ago)
Author:
marcus
Message:

r125 | klaus | 2010-04-19 14:07:17 +0200 (Mo, 19 Apr 2010) | 1 line

rewrite sfd from database is file does not exist any more

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/source/sqliface.c

    r71 r208  
    33 *      ========== 
    44 * 
    5  * $Revision: 56 $, $Date: 2008-10-28 16:01:29 +0100 (Di, 28 Okt 2008) $ 
     5 * $Revision: 125 $, $Date: 2010-04-19 14:07:17 +0200 (Mo, 19 Apr 2010) $ 
    66 * 
    77 * Interface to SQL databases 
     
    194194        double   rd1time, rd2time;                 /* read time as double */ 
    195195        int      rd1off, rd2off;                   /* date part of soffset, eoffset */ 
     196        FILE     *fp;                              /* file pointer */ 
     197        TSyBoolean rewrite_sfd;                    /* rewrite sfd file */ 
    196198 
    197199        /* executable code */ 
     
    207209        if  (SySevere(status))  return; 
    208210 
     211        /* if sfd file does not exist, create a new one irrespective of the 
     212         * given start time and length.  Try to open it, to see whether its there 
     213         */ 
     214        fp = fopen( sqlv_sfdb_tmp, "r" ); 
     215        if  (fp == NULL)  { 
     216                /* file does not exist, rewrite file */ 
     217                rewrite_sfd = TRUE; 
     218        } else { 
     219                rewrite_sfd = FALSE; 
     220                fclose( fp ); 
     221        } /*endif*/ 
     222 
    209223        /* call to db if new start time given */ 
    210         if  (strcmp(start,last_start) != 0 || readlth != last_readlth)  { 
     224        if  (strcmp(start,last_start) != 0 || readlth != last_readlth || rewrite_sfd)  { 
    211225                tc_nadd( &sntime, -86400*30*3, &soffset, status ); 
    212226                if  (SySevere(status))  return; 
Note: See TracChangeset for help on using the changeset viewer.