summaryrefslogtreecommitdiff
path: root/package/busybox/busybox-1.9.0-mkswap.patch
blob: ac7e1ecc5c81dc2a3ab30065d0e14e8ca05db731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- busybox-1.9.0/util-linux/mkswap.c	Fri Dec 21 22:00:33 2007
+++ busybox-1.9.0-mkswap/util-linux/mkswap.c	Sat Feb  2 18:55:31 2008
@@ -64,9 +64,10 @@
 	// 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]);