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

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