- fix btrfsck so it builds with newer glibcs

This commit is contained in:
Josef Bacik 2010-02-02 15:02:52 +00:00
parent cae92fdd04
commit 4ec8d566ed
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,32 @@
--- btrfs-progs-0.19/btrfsck.c
+++ btrfs-progs-0.19/btrfsck.c
@@ -21,6 +21,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "kerncompat.h"
#include "ctree.h"
#include "disk-io.h"
--- btrfs-progs-0.19/mkfs.c
+++ btrfs-progs-0.19/mkfs.c
@@ -341,7 +341,7 @@ int main(int ac, char **av)
u64 alloc_start = 0;
u64 metadata_profile = BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_DUP;
u64 data_profile = BTRFS_BLOCK_GROUP_RAID0;
- u32 leafsize = getpagesize();
+ u32 leafsize = sysconf(_SC_PAGESIZE);
u32 sectorsize = 4096;
u32 nodesize = leafsize;
u32 stripesize = 4096;
@@ -398,7 +398,7 @@ int main(int ac, char **av)
print_usage();
}
}
- sectorsize = max(sectorsize, (u32)getpagesize());
+ sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
if (leafsize < sectorsize || (leafsize & (sectorsize - 1))) {
fprintf(stderr, "Illegal leafsize %u\n", leafsize);
exit(1);

View File

@ -1,6 +1,6 @@
Name: btrfs-progs
Version: 0.19
Release: 8%{?dist}
Release: 9%{?dist}
Summary: Userspace programs for btrfs
Group: System Environment/Base
@ -11,6 +11,7 @@ Patch0: btrfs-progs-fix-labels.patch
Patch1: btrfs-progs-build-everything.patch
Patch2: btrfs-progs-valgrind.patch
Patch3: btrfs-progs-fix-return-value.patch
Patch4: btrfs-progs-build-fixes.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: e2fsprogs-devel, libuuid-devel, zlib-devel, libacl-devel
@ -27,6 +28,7 @@ check, modify and correct any inconsistencies in the btrfs filesystem.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
@ -58,6 +60,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/mkfs.btrfs.8.gz
%changelog
* Tue Feb 2 2010 Josef Bacik <josef@toxicpanda.com> 0.19-9
- fix btrfsck so it builds on newer glibcs
* Tue Feb 2 2010 Josef Bacik <josef@toxicpanda.com> 0.19-8
- fix btrfsctl to return 0 on success and 1 on failure