diff options
Diffstat (limited to 'fs/udf/udftime.c')
-rw-r--r-- | fs/udf/udftime.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/udf/udftime.c b/fs/udf/udftime.c index ce595732ba6f..12fae6cd444c 100644 --- a/fs/udf/udftime.c +++ b/fs/udf/udftime.c | |||
@@ -85,7 +85,7 @@ extern struct timezone sys_tz; | |||
85 | #define SECS_PER_HOUR (60 * 60) | 85 | #define SECS_PER_HOUR (60 * 60) |
86 | #define SECS_PER_DAY (SECS_PER_HOUR * 24) | 86 | #define SECS_PER_DAY (SECS_PER_HOUR * 24) |
87 | 87 | ||
88 | time_t *udf_stamp_to_time(time_t *dest, long *dest_usec, kernel_timestamp src) | 88 | struct timespec *udf_stamp_to_time(struct timespec *dest, kernel_timestamp src) |
89 | { | 89 | { |
90 | int yday; | 90 | int yday; |
91 | uint8_t type = src.typeAndTimezone >> 12; | 91 | uint8_t type = src.typeAndTimezone >> 12; |
@@ -97,23 +97,20 @@ time_t *udf_stamp_to_time(time_t *dest, long *dest_usec, kernel_timestamp src) | |||
97 | offset = (offset >> 4); | 97 | offset = (offset >> 4); |
98 | if (offset == -2047) /* unspecified offset */ | 98 | if (offset == -2047) /* unspecified offset */ |
99 | offset = 0; | 99 | offset = 0; |
100 | } else { | 100 | } else |
101 | offset = 0; | 101 | offset = 0; |
102 | } | ||
103 | 102 | ||
104 | if ((src.year < EPOCH_YEAR) || | 103 | if ((src.year < EPOCH_YEAR) || |
105 | (src.year >= EPOCH_YEAR + MAX_YEAR_SECONDS)) { | 104 | (src.year >= EPOCH_YEAR + MAX_YEAR_SECONDS)) { |
106 | *dest = -1; | ||
107 | *dest_usec = -1; | ||
108 | return NULL; | 105 | return NULL; |
109 | } | 106 | } |
110 | *dest = year_seconds[src.year - EPOCH_YEAR]; | 107 | dest->tv_sec = year_seconds[src.year - EPOCH_YEAR]; |
111 | *dest -= offset * 60; | 108 | dest->tv_sec -= offset * 60; |
112 | 109 | ||
113 | yday = ((__mon_yday[__isleap(src.year)][src.month - 1]) + src.day - 1); | 110 | yday = ((__mon_yday[__isleap(src.year)][src.month - 1]) + src.day - 1); |
114 | *dest += (((yday * 24) + src.hour) * 60 + src.minute) * 60 + src.second; | 111 | dest->tv_sec += (((yday * 24) + src.hour) * 60 + src.minute) * 60 + src.second; |
115 | *dest_usec = src.centiseconds * 10000 + | 112 | dest->tv_nsec = 1000 * (src.centiseconds * 10000 + |
116 | src.hundredsOfMicroseconds * 100 + src.microseconds; | 113 | src.hundredsOfMicroseconds * 100 + src.microseconds); |
117 | return dest; | 114 | return dest; |
118 | } | 115 | } |
119 | 116 | ||