Hi Jelle, I need to have them in git patch-format format... This allows me to review, then add/commit them with a single command (git am ...).Otherwise, I have to manually apply the patch, type a commit message for you, and commit it myself, while ensuring you get the credit. I just don't have time for that. The same goes for the other patch follwing that you sent. Thanks.
I see your point. Here's the new one. Cheers, Jelle
>From e3451b24c83669aa7916d5fa2dfafe723fca6920 Mon Sep 17 00:00:00 2001 From: Jelle Hermsen <je...@jellehermsen.nl> Date: Thu, 27 Sep 2012 03:03:27 +0200 Subject: [PATCH] Teach ToolTalk config about NetBSD and adds HAS_STATVFS identifier which is consequently used in tt_file_system.C, because NetBSD switched to the POSIX/XOpen statvfs() calls in 2004. --- cde/lib/tt/lib/tt_options.h | 31 ++++++++++++++++++++++++ cde/lib/tt/lib/util/tt_file_system.C | 47 ++++++++++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/cde/lib/tt/lib/tt_options.h b/cde/lib/tt/lib/tt_options.h index fef3512..1889422 100644 --- a/cde/lib/tt/lib/tt_options.h +++ b/cde/lib/tt/lib/tt_options.h @@ -624,6 +624,37 @@ # undef OPT_XTHREADS # define OPT_CONST_CORRECT +#elif defined(__NetBSD__) +# undef OPT_UNIX_SOCKET_RPC +# undef OPT_TLI +# undef OPT_DLOPEN_X11 +# undef OPT_DLOPEN_CE +# undef OPT_ADDMSG_DIRECT +# undef OPT_SECURE_RPC +# undef OPT_CLASSING_ENGINE +# undef OPT_PATCH +# define OPT_POSIX_SIGNAL +# undef OPT_BSD_WAIT +# undef OPT_DGETTEXT +# define OPT_CATGETS +# undef OPT_GETDTABLESIZE +# undef OPT_SYSINFO +# define OPT_CPP_PATH "/usr/bin/cpp" +# define OPT_CPP_OPTIONS "" +# define OPT_STRERROR +# undef OPT_SVR4_GETMNTENT +# undef OPT_LOCKF_MNTENT +# define OPT_LOCAL_MOUNT_TYPE MNTTYPE_UFS +# undef OPT_OLD_RPC +# define OPT_DEFINE_SIG_PF +# define OPT_TAR_HAS_EXCLUDE_OPTION +# define OPT_HAS_REALPATH +# define OPT_AUTOMOUNT_PATH_FIX +# define OPT_BUG_RPCINTR +# undef OPT_XTHREADS +# define OPT_CONST_CORRECT +# define HAS_STATVFS + #else /* Unknown configuration, complain */ }}}} You must edit lib/tt_options.h and add a section defining the options for your configuration. diff --git a/cde/lib/tt/lib/util/tt_file_system.C b/cde/lib/tt/lib/util/tt_file_system.C index 074d2a5..3718762 100644 --- a/cde/lib/tt/lib/util/tt_file_system.C +++ b/cde/lib/tt/lib/util/tt_file_system.C @@ -85,12 +85,24 @@ #elif defined(__osf__) || defined(CSRG_BASED) # include <sys/types.h> # include <sys/mount.h> -# ifdef __osf__ + + +#if defined(HAS_STATVFS) + extern "C" int getfsstat(struct statvfs *, long, int); +#elif defined(__osf__) extern "C" int getfsstat(struct statfs *, long, int); # endif + # define MNTTYPE_NFS "nfs" # define ttOpenMntTbl(path,mode) ((FILE *) 1) -# define TtMntEntry struct statfs * + +# if defined(HAS_STATVFS) +# include <sys/statvfs.h> +# define TtMntEntry struct statvfs * +# else +# define TtMntEntry struct statfs * +# endif + # ifdef __osf__ # define ttFsType(e) \ (((e)->f_type == MOUNT_UFS) ? "ufs" \ @@ -466,6 +478,37 @@ updateFileSystemEntries () for (entry = (TtMntEntry)tmpbuf; rc > 0; --rc, entry = (TtMntEntry)((char *) entry + entry->vmt_length)) + +#elif defined(HAS_STATVFS) + int numfs,i; + struct statvfs *buf; + long bufsize; + int flags = MNT_NOWAIT; + char *s, *host, path[MNAMELEN] ; + + numfs = getvfsstat ( (struct statvfs *)0, 0, 0 ); + + bufsize = numfs * sizeof ( struct statvfs ); + buf = (struct statvfs *) malloc ( bufsize ); + memset ((void *)buf,0,bufsize); + + getvfsstat ( buf, bufsize, flags ); + + for ( i=0; i<numfs; i++ ) + { + // convert path@host to host:/path + s = strchr(buf[i].f_mntfromname,'@'); + if (s != NULL) { + host = s + 1 ; + memset((char*)path,0,MNAMELEN); + strncpy(path,buf[i].f_mntfromname, (strlen(buf[i].f_mntfromname) + - strlen(s))) ; + strcpy(buf[i].f_mntfromname,host) ; + strcat(buf[i].f_mntfromname,":") ; + strcat(buf[i].f_mntfromname,path) ; + } + entry = &buf[i]; + #elif defined(__osf__) || defined(CSRG_BASED) int numfs,i; struct statfs *buf; -- 1.7.11.3
------------------------------------------------------------------------------ Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________ cdesktopenv-devel mailing list cdesktopenv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel