Re: [evolution-patches] (groupwise provider) change in modification time




I'd suggest one minor change:
if the stat fails, then use time(0), otherwise dont default the value to time(0) since you always overwrite it with the stat call's response anyway.

e.g.
              time_t mod_time;

       cache_file_name = g_strdup (folder->summary->summary_path);
       if (stat(cache_file_name, &buf) == 0)
           mod_time = buf.st_mtime;
              else
                     mod_time = time(0);

       g_free(cache_file_name);

also, get out of the habit of putting spaces before the final ';' on every line, it is a totally inconcistent style with anything else in evolution, or anything i've ever seen anywhere else for that matter.


On Thu, 2005-02-17 at 10:38 +0530, Parthasarathi Susarla wrote:
Attached is the revised patch.
The modification time now would be got from the summary file itself, so
'stat'ing of the summary file is required each time. 
No more static variable
Thanks 
-partha
On Thu, 2005-02-17 at 08:06 +0800, Not Zed wrote:
>
>Please use time(0) rather than g_get_current_time().
>
>Also, rather than using a static variable which wont be thread-safe,
>just call time(0) before calling gmtime().
>
>This code then seems redundant  (its stating of the summary doesn't
>seem that useful anyway).
>
>if (!mod_time) {
>cache_file_name = g_strdup (folder->summary->summary_path) ;
>stat (cache_file_name, &buf) ;
>mod_time = buf.st_mtime ;
>g_free (cache_file_name) ;
>}
>
>tm = gmtime (&mod_time) ;
>
>On Wed, 2005-02-16 at 15:55 +0530, Parthasarathi Susarla wrote: 
>>Hi,
>>this patch updates the modification time that is sent with each
>>getQuickMessage request.
>>
>>thanks,
>>partha


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