diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-02-28 10:19:49 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-02-28 10:19:49 +0000 |
commit | fcd8d64078444c08fe103a11e3291bd170182ec2 (patch) | |
tree | 88edd14320268e648ed10ed7721118271d337797 /tools/xentrace/xentrace.c | |
parent | 8d54d051da3dd1fd9e7666b7b74b074676c8571f (diff) | |
download | xen-fcd8d64078444c08fe103a11e3291bd170182ec2.tar.gz xen-fcd8d64078444c08fe103a11e3291bd170182ec2.tar.bz2 xen-fcd8d64078444c08fe103a11e3291bd170182ec2.zip |
Fix non-portability in xentrace
Replace statfs() with the equivalent statvfs(), and correct the block
size multiplier.
Signed-off-by: John Levon <john.levon@sun.com>
Diffstat (limited to 'tools/xentrace/xentrace.c')
-rw-r--r-- | tools/xentrace/xentrace.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c index 526a69f73d..aaef3f09fb 100644 --- a/tools/xentrace/xentrace.c +++ b/tools/xentrace/xentrace.c @@ -15,7 +15,6 @@ #include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> -#include <sys/vfs.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> @@ -25,6 +24,7 @@ #include <getopt.h> #include <assert.h> #include <sys/poll.h> +#include <sys/statvfs.h> #include <xen/xen.h> #include <xen/trace.h> @@ -87,7 +87,7 @@ void close_handler(int signal) void write_buffer(unsigned int cpu, unsigned char *start, int size, int total_size, int outfd) { - struct statfs stat; + struct statvfs stat; size_t written = 0; if ( opts.disk_rsvd != 0 ) @@ -95,13 +95,13 @@ void write_buffer(unsigned int cpu, unsigned char *start, int size, unsigned long long freespace; /* Check that filesystem has enough space. */ - if ( fstatfs (outfd, &stat) ) + if ( fstatvfs (outfd, &stat) ) { fprintf(stderr, "Statfs failed!\n"); goto fail; } - freespace = stat.f_bsize * (unsigned long long)stat.f_bfree; + freespace = stat.f_frsize * (unsigned long long)stat.f_bfree; if ( total_size ) freespace -= total_size; |