kernel: Fix time64_to_tm scope
This commit is contained in:
@@ -14,23 +14,6 @@
|
|||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <linux/crc32.h>
|
#include <linux/crc32.h>
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
|
||||||
#include <linux/rtc.h>
|
|
||||||
|
|
||||||
static inline void time64_to_tm(time64_t totalsecs, int offset, struct tm *result)
|
|
||||||
{
|
|
||||||
struct rtc_time rtc_tm;
|
|
||||||
rtc_time64_to_tm(totalsecs, &rtc_tm);
|
|
||||||
|
|
||||||
result->tm_sec = rtc_tm.tm_sec;
|
|
||||||
result->tm_min = rtc_tm.tm_min;
|
|
||||||
result->tm_hour = rtc_tm.tm_hour;
|
|
||||||
result->tm_mday = rtc_tm.tm_mday;
|
|
||||||
result->tm_mon = rtc_tm.tm_mon;
|
|
||||||
result->tm_year = rtc_tm.tm_year;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "klog.h"
|
#include "klog.h"
|
||||||
#include "kernel_compat.h"
|
#include "kernel_compat.h"
|
||||||
#include "sulog.h"
|
#include "sulog.h"
|
||||||
|
|||||||
@@ -15,6 +15,23 @@ extern struct timezone sys_tz;
|
|||||||
#define SULOG_COMM_LEN 256
|
#define SULOG_COMM_LEN 256
|
||||||
#define DEDUP_SECS 10
|
#define DEDUP_SECS 10
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
|
||||||
|
#include <linux/rtc.h>
|
||||||
|
|
||||||
|
static inline void time64_to_tm(time64_t totalsecs, int offset, struct tm *result)
|
||||||
|
{
|
||||||
|
struct rtc_time rtc_tm;
|
||||||
|
rtc_time64_to_tm(totalsecs, &rtc_tm);
|
||||||
|
|
||||||
|
result->tm_sec = rtc_tm.tm_sec;
|
||||||
|
result->tm_min = rtc_tm.tm_min;
|
||||||
|
result->tm_hour = rtc_tm.tm_hour;
|
||||||
|
result->tm_mday = rtc_tm.tm_mday;
|
||||||
|
result->tm_mon = rtc_tm.tm_mon;
|
||||||
|
result->tm_year = rtc_tm.tm_year;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct dedup_key {
|
struct dedup_key {
|
||||||
u32 crc;
|
u32 crc;
|
||||||
uid_t uid;
|
uid_t uid;
|
||||||
|
|||||||
Reference in New Issue
Block a user