summaryrefslogtreecommitdiffstats
path: root/patches/busybox-1.9.0/generic/busybox-1.9.0-mkswap.patch
blob: dc18b292e400d045f620b9dc7bf86c7255b311a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Subject: busybox 1.9.0 fixes
From: http://busybox.net/downloads/fixes-1.9.0

---
 util-linux/mkswap.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: busybox-1.9.0/util-linux/mkswap.c
===================================================================
--- busybox-1.9.0.orig/util-linux/mkswap.c
+++ busybox-1.9.0/util-linux/mkswap.c
@@ -64,9 +64,10 @@ int mkswap_main(int argc, char **argv)
 	// Figure out how big the device is and announce our intentions.
 
 	fd = xopen(argv[1], O_RDWR);
-	len = fdlength(fd);
+	len = lseek(fd, 0, SEEK_END);
+	lseek(fd, 0, SEEK_SET);
 	pagesize = getpagesize();
-	printf("Setting up swapspace version 1, size = %"OFF_FMT"d bytes\n",
+	printf("Setting up swapspace version 1, size = %"OFF_FMT"u bytes\n",
 			len - pagesize);
 	mkswap_selinux_setcontext(fd, argv[1]);