Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 411828 Details for
Bug 549100
sys-fs/xfsprogs - patches for building in a musl environment
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Common fix (against current git) for ustat
xfsprogs-ustat.patch (text/plain), 1.49 KB, created by
Felix Janda
on 2015-09-13 20:43:15 UTC
(
hide
)
Description:
Common fix (against current git) for ustat
Filename:
MIME Type:
Creator:
Felix Janda
Created:
2015-09-13 20:43:15 UTC
Size:
1.49 KB
patch
obsolete
>diff --git a/libxfs/linux.c b/libxfs/linux.c >index 885016a..38469c5 100644 >--- a/libxfs/linux.c >+++ b/libxfs/linux.c >@@ -16,11 +16,8 @@ > * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > */ > >-#define ustat __kernel_ustat > #include <mntent.h> > #include <sys/stat.h> >-#undef ustat >-#include <sys/ustat.h> > #include <sys/mount.h> > #include <sys/ioctl.h> > #include <sys/sysinfo.h> >@@ -51,9 +48,10 @@ 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 stat64 st; >+ FILE *f; >+ struct stat64 st, mst; >+ struct mntent *mnt; >+ char mounts[MAXPATHLEN]; > > if (!s) { > if (stat64(block, &st) < 0) >@@ -63,14 +61,27 @@ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) > s = &st; > } > >- if (ustat(s->st_rdev, ust) >= 0) { >+ strcpy(mounts, (!access(PROC_MOUNTED, R_OK)) ? PROC_MOUNTED : MOUNTED); >+ if ((f = setmntent(mounts, "r")) == NULL) { >+ fprintf(stderr, >+ _("%s: %s possibly contains a mounted filesystem\n"), >+ progname, name); >+ return 1; >+ } >+ while ((mnt = getmntent(f)) != NULL) { >+ if (stat64(mnt->mnt_dir, &mst) < 0) >+ continue; >+ if (mst.st_dev != s->st_rdev) >+ continue; >+ > if (verbose) > fprintf(stderr, > _("%s: %s contains a mounted filesystem\n"), > progname, name); >- return 1; >+ break; > } >- return 0; >+ endmntent(f); >+ return mnt == NULL; > } > > int
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 549100
:
402982
|
402984
| 411828