diff options
author | Will Andrews <will@FreeBSD.org> | 2000-11-02 23:00:33 +0000 |
---|---|---|
committer | Will Andrews <will@FreeBSD.org> | 2000-11-02 23:00:33 +0000 |
commit | 07be7e6d9dbb7ac0c164e5945c8b1c2b44ba895e (patch) | |
tree | 1b7d50eadce0a690fb974b1b0b9cbe0caf2db6cd /x11 | |
parent | 36293b0d4e5e5aada85cc67ad9e603fedd477b1b (diff) | |
download | ports-07be7e6d9dbb7ac0c164e5945c8b1c2b44ba895e.tar.gz ports-07be7e6d9dbb7ac0c164e5945c8b1c2b44ba895e.zip |
Add patch to fix mount checking. Already in KDE bugs database.
PR: 22551
Submitted by: nsayer
Notes
Notes:
svn path=/head/; revision=34688
Diffstat (limited to 'x11')
-rw-r--r-- | x11/kdelibs2/files/patch-global.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/x11/kdelibs2/files/patch-global.cpp b/x11/kdelibs2/files/patch-global.cpp new file mode 100644 index 000000000000..80b4cb467a6d --- /dev/null +++ b/x11/kdelibs2/files/patch-global.cpp @@ -0,0 +1,55 @@ +--- kio/global.cpp.orig Mon Sep 18 07:24:44 2000 ++++ kio/global.cpp Thu Nov 2 11:37:24 2000 +@@ -28,6 +28,12 @@ + #include <string.h> + #include <unistd.h> + ++#ifdef __FreeBSD__ ++#include <sys/param.h> ++#include <sys/ucred.h> ++#include <sys/mount.h> ++#endif ++ + #ifdef HAVE_FSTAB_H + #include <fstab.h> + #endif +@@ -423,6 +429,30 @@ + + /* Get the list of mounted file systems */ + ++#ifdef __FreeBSD__ ++ ++ QString result; ++ struct statfs *mounted; ++ ++ int num_fs = getmntinfo(&mounted, MNT_NOWAIT); ++ ++ for (int i=0;i<num_fs;i++) { ++ ++ QCString device_name = mounted[i].f_mntfromname; ++ ++ // If the path contains symlinks, get ++ // the real name ++ if (realpath(device_name, realpath_buffer) != 0) ++ // succes, use result from realpath ++ device_name = realpath_buffer; ++ ++ if (realname == device_name) { ++ result = mounted[i].f_mntonname; ++ break; ++ } ++ } ++ ++#else + if ((mtab = SETMNTENT(MNTTAB, "r")) == 0) { + perror("setmntent"); + return QString::null; +@@ -467,6 +497,7 @@ + + ENDMNTENT(mtab); + //kdDebug( 7007 ) << "Returning result " << result << endl; ++#endif + return result; + } + + |