From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id q21LELF2187409 for ; Thu, 1 Mar 2012 15:14:21 -0600 Received: from MMS3.broadcom.com (mms3.broadcom.com [216.31.210.19]) by cuda.sgi.com with ESMTP id EN5xnXt8f6M6fczc for ; Thu, 01 Mar 2012 13:14:20 -0800 (PST) From: "Kamal Dasu" Subject: [PATCH 1/2] xfsprogs: replace deprecated ustat call with statfs in libxfs/linux.c Date: Thu, 1 Mar 2012 16:11:24 -0500 Message-ID: In-Reply-To: <1330636285-11200-1-git-send-email-kdasu.kdev@gmail.com> References: <1330636285-11200-1-git-send-email-kdasu.kdev@gmail.com> MIME-Version: 1.0 List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com Cc: Kamal Dasu >>From the ustat man page NOTES ustat() is deprecated and has only been provided for compatibility. All new programs should use statfs(2) instead. Signed-off-by: Kamal Dasu --- libxfs/linux.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libxfs/linux.c b/libxfs/linux.c index 2e07d54..b8cc028 100644 --- a/libxfs/linux.c +++ b/libxfs/linux.c @@ -21,7 +21,9 @@ #include #include #undef ustat -#include +#include +#include + #include #include #include @@ -50,7 +52,7 @@ int platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) { /* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */ - struct ustat ust[2]; + struct statfs fst; struct stat64 st; if (!s) { @@ -61,7 +63,7 @@ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) s = &st; } - if (ustat(s->st_rdev, ust) >= 0) { + if (statfs(block, &fst) >= 0) { if (verbose) fprintf(stderr, _("%s: %s contains a mounted filesystem\n"), -- 1.7.5.4 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs