aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/audit.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/tomoyo/audit.c')
-rw-r--r--security/tomoyo/audit.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/security/tomoyo/audit.c b/security/tomoyo/audit.c
index 45e0a9f3c384..f2c869767d79 100644
--- a/security/tomoyo/audit.c
+++ b/security/tomoyo/audit.c
@@ -10,47 +10,6 @@
10#include <linux/slab.h> 10#include <linux/slab.h>
11 11
12/** 12/**
13 * tomoyo_convert_time - Convert time_t to YYYY/MM/DD hh/mm/ss.
14 *
15 * @time: Seconds since 1970/01/01 00:00:00.
16 * @stamp: Pointer to "struct tomoyo_time".
17 *
18 * Returns nothing.
19 *
20 * This function does not handle Y2038 problem.
21 */
22static void tomoyo_convert_time(time_t time, struct tomoyo_time *stamp)
23{
24 static const u16 tomoyo_eom[2][12] = {
25 { 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
26 { 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
27 };
28 u16 y;
29 u8 m;
30 bool r;
31 stamp->sec = time % 60;
32 time /= 60;
33 stamp->min = time % 60;
34 time /= 60;
35 stamp->hour = time % 24;
36 time /= 24;
37 for (y = 1970; ; y++) {
38 const unsigned short days = (y & 3) ? 365 : 366;
39 if (time < days)
40 break;
41 time -= days;
42 }
43 r = (y & 3) == 0;
44 for (m = 0; m < 11 && time >= tomoyo_eom[r][m]; m++)
45 ;
46 if (m)
47 time -= tomoyo_eom[r][m - 1];
48 stamp->year = y;
49 stamp->month = ++m;
50 stamp->day = ++time;
51}
52
53/**
54 * tomoyo_print_header - Get header line of audit log. 13 * tomoyo_print_header - Get header line of audit log.
55 * 14 *
56 * @r: Pointer to "struct tomoyo_request_info". 15 * @r: Pointer to "struct tomoyo_request_info".