Ignore:
Timestamp:
Sep 24, 2013, 5:37:22 PM (12 years ago)
Author:
Silvan Scherrer
Message:

Samba Client 2.1: some more timestamp work

Location:
branches/client-2.1/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/client-2.1/src/ndpsmb.c

    r813 r816  
    6262        struct tm gmtime = { 0 };
    6363
    64         debug_printf( "fsphDosDateToUnixTime time %02d:%02d\n", ftime.hours, ftime.minutes);
     64        debug_printf( "fsphDosDateToUnixTime time %02d:%02d:%02d\n", ftime.hours, ftime.minutes, ftime.twosecs*2);
    6565        gmtime.tm_mday = fdate.day;
    6666        gmtime.tm_mon = fdate.month-1;
     
    8080        *time += 3600;
    8181        }
     82        debug_printf( "fsphDosDateToUnixTime time2 %d %s", *time, ctime( (time_t*)time));
    8283#endif
    83         debug_printf( "fsphDosDateToUnixTime time2 %d %s", *time, ctime( (time_t*)time));
    8484}
    8585       
  • branches/client-2.1/src/smbwrp.c

    r815 r816  
    688688        }
    689689
     690        debuglocal(4,"smpwrp_close updatetime: %d\n", file->updatetime);
     691
     692        if (file->updatetime == 1)
     693        {
     694                file->mtime = time(NULL);
     695                debuglocal(4,"cli_close new mtime %lu\n", file->mtime);
     696        }
     697
     698        if (file->updatetime == 2 && !cli_setattrE(cli, file->fd, file->ctime, 0, file->mtime))
     699        {
     700                debuglocal(4,"Set attrE on close failed %d\n", os2cli_errno(cli));
     701        }
    690702       
    691703        if (!cli_close(cli, file->fd))
    692704        {
    693                 return os2cli_errno(cli);
    694         }
    695         if (file->updatetime == 2 && !cli_setattrE(cli, file->fd, file->ctime, 0, file->mtime))
    696         {
    697                 debuglocal(4,"Set attrE on close failed %d\n", os2cli_errno(cli));
    698         }
    699         if (file->updatetime == 1)
    700         {
    701                 file->mtime = time(NULL);
    702                 debuglocal(4,"cli_close new mtime %lu\n", file->mtime);
    703         }
     705                rc = os2cli_errno(cli);
     706        }
     707
     708        if (!rc && (file->openattr || file->mtime))
     709        {
     710                debuglocal(4,"Set attr on close %s %08x %d %d\n", file->fname, file->openattr, file->mtime, file->mtime);
     711                if (!cli_setatr(cli, file->fname, file->openattr, file->mtime))
     712                {
     713                        debuglocal(4,"Set attr on close failed %d\n", os2cli_errno(cli));
     714                        //rc = os2cli_errno(cli);
     715                }
     716               
     717        }
     718
     719        file->openattr = 0;
     720        file->mtime = 0;
    704721        file->updatetime = 0;           
    705722        file->fd = -1;
    706723        file->offset = 0;
    707         if (file->openattr || file->mtime)
    708         {
    709                 debuglocal(4,"Set attr on close %s %08x %d %d\n", file->fname, file->openattr, file->mtime, file->mtime);
    710                 if (!cli_setatr(cli, file->fname, file->openattr, file->mtime))
    711                 {
    712                         debuglocal(4,"Set attr on close failed %d\n", os2cli_errno(cli));
    713                         //rc = os2cli_errno(cli);
    714                 }
    715                
    716                 file->openattr = 0;
    717                 file->mtime = 0;
    718         }
    719724        *file->fname = 0;
    720725        return rc;
Note: See TracChangeset for help on using the changeset viewer.