Blame SOURCES/xfsprogs-5.10.0-libfrog-convert-cvttime-to-return-time64_t.patch

0bf83d
From bf6d4cf988176ad7efd0089830bfbf200a5e0196 Mon Sep 17 00:00:00 2001
0bf83d
From: "Darrick J. Wong" <darrick.wong@oracle.com>
0bf83d
Date: Fri, 20 Nov 2020 17:03:27 -0500
0bf83d
Subject: [PATCH] libfrog: convert cvttime to return time64_t
0bf83d
0bf83d
Change the cvttime function to return 64-bit time values so that we can
0bf83d
put them to use with the bigtime feature.
0bf83d
0bf83d
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
0bf83d
Reviewed-by: Christoph Hellwig <hch@lst.de>
0bf83d
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
0bf83d
---
0bf83d
0bf83d
diff --git a/include/convert.h b/include/convert.h
0bf83d
index 0489a1d..2b427df 100644
0bf83d
--- a/include/convert.h
0bf83d
+++ b/include/convert.h
0bf83d
@@ -16,7 +16,7 @@ extern uint16_t	cvt_u16(char *s, int base);
0bf83d
 
0bf83d
 extern long long cvtnum(size_t blocksize, size_t sectorsize, char *s);
0bf83d
 extern void cvtstr(double value, char *str, size_t sz);
0bf83d
-extern unsigned long cvttime(char *s);
0bf83d
+extern time64_t cvttime(char *s);
0bf83d
 
0bf83d
 extern uid_t	uid_from_string(char *user);
0bf83d
 extern gid_t	gid_from_string(char *group);
0bf83d
diff --git a/libfrog/convert.c b/libfrog/convert.c
0bf83d
index ed4cae7..209b874 100644
0bf83d
--- a/libfrog/convert.c
0bf83d
+++ b/libfrog/convert.c
0bf83d
@@ -267,14 +267,14 @@ cvtstr(
0bf83d
 #define DAYS_TO_SECONDS(d)	((d) * HOURS_TO_SECONDS(24))
0bf83d
 #define WEEKS_TO_SECONDS(w)	((w) * DAYS_TO_SECONDS(7))
0bf83d
 
0bf83d
-unsigned long
0bf83d
+time64_t
0bf83d
 cvttime(
0bf83d
 	char		*s)
0bf83d
 {
0bf83d
-	unsigned long	i;
0bf83d
+	time64_t	i;
0bf83d
 	char		*sp;
0bf83d
 
0bf83d
-	i = strtoul(s, &sp, 0);
0bf83d
+	i = strtoll(s, &sp, 0);
0bf83d
 	if (i == 0 && sp == s)
0bf83d
 		return 0;
0bf83d
 	if (*sp == '\0')
0bf83d
diff --git a/quota/edit.c b/quota/edit.c
0bf83d
index 01d358f..b3cad02 100644
0bf83d
--- a/quota/edit.c
0bf83d
+++ b/quota/edit.c
0bf83d
@@ -419,13 +419,13 @@ restore_f(
0bf83d
 
0bf83d
 static void
0bf83d
 set_timer(
0bf83d
-	uint32_t	id,
0bf83d
-	uint		type,
0bf83d
-	uint		mask,
0bf83d
-	char		*dev,
0bf83d
-	uint		value)
0bf83d
+	uint32_t		id,
0bf83d
+	uint			type,
0bf83d
+	uint			mask,
0bf83d
+	char			*dev,
0bf83d
+	time64_t		value)
0bf83d
 {
0bf83d
-	fs_disk_quota_t	d;
0bf83d
+	struct fs_disk_quota	d;
0bf83d
 
0bf83d
 	memset(&d, 0, sizeof(d));
0bf83d
 
0bf83d
@@ -476,7 +476,7 @@ timer_f(
0bf83d
 	int		argc,
0bf83d
 	char		**argv)
0bf83d
 {
0bf83d
-	uint		value;
0bf83d
+	time64_t	value;
0bf83d
 	char		*name = NULL;
0bf83d
 	uint32_t	id = 0;
0bf83d
 	int		c, flags = 0, type = 0, mask = 0;