From 0d9236d4e9877f66c8fd75c817efa3a6dc2b903a Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 28 Mar 2015 02:21:35 +0000 Subject: [PATCH] - Round up modification time to the next even second because of FAT's two-second granularity in this field. When copying files based on newness, it is better to have a time one second newer than it should be rather than one second older. - Removed the manual version string that was already superseded by a generated one. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@50246 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- rom/filesys/fat/fat.c | 7 +++++-- rom/filesys/fat/fat.conf | 2 +- rom/filesys/fat/main.c | 4 +--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/rom/filesys/fat/fat.c b/rom/filesys/fat/fat.c index e6afc87b95..a64cf58ab4 100644 --- a/rom/filesys/fat/fat.c +++ b/rom/filesys/fat/fat.c @@ -2,7 +2,7 @@ * fat-handler - FAT12/16/32 filesystem handler * * Copyright © 2006 Marek Szyprowski - * Copyright © 2007-2013 The AROS Development Team + * Copyright © 2007-2015 The AROS Development Team * * This program is free software; you can redistribute it and/or modify it * under the same terms as AROS itself. @@ -673,7 +673,7 @@ void ConvertFATDate(UWORD date, UWORD time, struct DateStamp *ds) { /* time bits: hhhh hmmm mmms ssss */ hours = (time & 0xf800) >> 11; /* bits 15-11 */ - mins = (time & 0x07e0) >> 5; /* bits 8-5 */ + mins = (time & 0x07e0) >> 5; /* bits 10-5 */ secs = time & 0x001f; /* bits 4-0 */ D(bug("[fat] converting fat date: year %d month %d day %d hours %d mins %d secs %d\n", year, month, day, hours, mins, secs)); @@ -706,6 +706,9 @@ void ConvertAROSDate(struct DateStamp *ds, UWORD *date, UWORD *time) { secs = ds->ds_Days * 60 * 60 * 24 + ds->ds_Minute * 60 + ds->ds_Tick / TICKS_PER_SECOND; + /* Round up to next even second because of FAT's two-second granularity */ + secs = (secs & ~1) + 2; + /* convert seconds since 1978 to calendar/time data */ Amiga2Date(secs, &clock_data); diff --git a/rom/filesys/fat/fat.conf b/rom/filesys/fat/fat.conf index ca208866bd..52f79d90cc 100644 --- a/rom/filesys/fat/fat.conf +++ b/rom/filesys/fat/fat.conf @@ -1,5 +1,5 @@ ##begin config -version 41.54 +version 41.59 basename fat residentpri -1 handler_func handler diff --git a/rom/filesys/fat/main.c b/rom/filesys/fat/main.c index f19a43215f..a62bd64d2b 100644 --- a/rom/filesys/fat/main.c +++ b/rom/filesys/fat/main.c @@ -2,7 +2,7 @@ * fat-handler - FAT12/16/32 filesystem handler * * Copyright © 2006 Marek Szyprowski - * Copyright © 2007-2014 The AROS Development Team + * Copyright © 2007-2015 The AROS Development Team * * This program is free software; you can redistribute it and/or modify it * under the same terms as AROS itself. @@ -40,8 +40,6 @@ struct Library *IntuitionBase; struct Globals global_data; struct Globals *glob = &global_data; -const TEXT version_string[] = "$VER: fat-handler 41.58 (28.11.2014)"; - LONG handler(struct ExecBase *SysBase) { struct Message *msg; struct DosPacket *startuppacket; -- 2.11.4.GIT