blob: 3497ca5409b26f6881f67f84925fb12c01c13c5d [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 3b95786af13e28157d889bd90a384ee255f2d91d Mon Sep 17 00:00:00 2001
2From: "Yann E. MORIN" <yann.morin.1998@free.fr>
3Date: Sun, 16 Aug 2015 15:55:43 +0200
4Subject: [PATCH] mkfs.fat: fix incorrect int type
5
6u_int32_t is not a stanard type, while uint32_t is. This fixes builds
7with the musl C library, which only defines so-called "clean" headers;
8build failures are like (back-quotes and elision manually added for
9readability):
10
11 http://autobuild.buildroot.org/results/a09/a0923d7f6d4dbae02eba4c5024bbdae3a52aa85a/build-end.log
12
13 /home/peko/autobuild/instance-1/output/host/usr/bin/x86_64-linux-gcc -D_LARGEFILE_SOURCE \
14 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_GNU_SOURCE -D_LARGEFILE_SOURCE \
15 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o mkfs.fat.o src/mkfs.fat.c
16 src/mkfs.fat.c: In function 'main':
17 src/mkfs.fat.c:1415:18: error: 'u_int32_t' undeclared (first use in this function)
18 volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); [...]
19 ^
20 src/mkfs.fat.c:1415:18: note: each undeclared identifier is reported only once for each
21 function it appears in
22
23Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
24Signed-off-by: Andreas Bombe <aeb@debian.org>
25---
26Upstream-Status: Backport
27
28 src/mkfs.fat.c | 2 +-
29 1 file changed, 1 insertion(+), 1 deletion(-)
30
31diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
32index b38d116..dddbe24 100644
33--- a/src/mkfs.fat.c
34+++ b/src/mkfs.fat.c
35@@ -1412,7 +1412,7 @@ int main(int argc, char **argv)
36
37 gettimeofday(&create_timeval, NULL);
38 create_time = create_timeval.tv_sec;
39- volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
40+ volume_id = (uint32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
41 check_atari();
42
43 printf("mkfs.fat " VERSION " (" VERSION_DATE ")\n");
44--
452.7.0
46