Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 421544 Details for
Bug 477758
sys-fs/xfsprogs - Various uClibc fixes for xfsprogs-4.3.0
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Use statfs() over ustat() for xfsprogs-4.3.0
xfsprogs-4.3.0-use-statfs.patch (text/plain), 1.71 KB, created by
Joshua Kinard
on 2016-01-01 21:21:27 UTC
(
hide
)
Description:
Use statfs() over ustat() for xfsprogs-4.3.0
Filename:
MIME Type:
Creator:
Joshua Kinard
Created:
2016-01-01 21:21:27 UTC
Size:
1.71 KB
patch
obsolete
>diff -Naurp xfsprogs-4.3.0.orig/libxfs/linux.c xfsprogs-4.3.0/libxfs/linux.c >--- xfsprogs-4.3.0.orig/libxfs/linux.c 2015-08-03 00:39:42.000000000 +0000 >+++ xfsprogs-4.3.0/libxfs/linux.c 2016-01-01 10:49:06.272229000 +0000 >@@ -20,7 +20,7 @@ > #include <mntent.h> > #include <sys/stat.h> > #undef ustat >-#include <sys/ustat.h> >+#include <sys/statvfs.h> > #include <sys/mount.h> > #include <sys/ioctl.h> > #include <sys/sysinfo.h> >@@ -51,9 +51,11 @@ static int max_block_alignment; > 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 ust; > struct stat64 st; >+ char mounts[MAXPATHLEN]; >+ FILE* mtab; >+ struct mntent* mnt; > > if (!s) { > if (stat64(block, &st) < 0) >@@ -63,7 +65,32 @@ platform_check_ismounted(char *name, cha > s = &st; > } > >- if (ustat(s->st_rdev, ust) >= 0) { >+ if (strcmp(name, block) == 0) { >+ /* Device node was passed as parameter. Find its mount point */ >+ strcpy(mounts, (!access(PROC_MOUNTED, R_OK)) ? PROC_MOUNTED : MOUNTED); >+ mtab = setmntent(mounts, "r"); >+ if (mtab == NULL) { >+ if (verbose) { >+ fprintf(stderr, _("%s: %s contains a possibly mounted filesystem\n"), progname, name); >+ } >+ return 1; >+ } >+ else { >+ mnt = getmntent(mtab); >+ while (mnt != NULL) { >+ if (strcmp(block, mnt->mnt_fsname) == 0) { >+ if (verbose) { >+ fprintf(stderr, _("%s: %s contains a mounted filesystem\n"), progname, name); >+ } >+ endmntent(mtab); >+ return 1; >+ } >+ mnt = getmntent(mtab); >+ } >+ endmntent(mtab); >+ } >+ } >+ else if (statfs(name, &ust) >= 0) { > if (verbose) > fprintf(stderr, > _("%s: %s contains a mounted filesystem\n"),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 477758
:
372888
|
372890
|
372894
|
372896
|
372898
|
374830
|
406570
|
406572
|
421540
|
421542
| 421544 |
421546