diff options
author | jirib@503223f0610c6c66f4e6dc738a5a0b2648c290b1 <jirib@web> | 2015-10-04 13:37:53 +0000 |
---|---|---|
committer | admin <admin@branchable.com> | 2015-10-04 13:37:53 +0000 |
commit | 7a10beed4d5e668948d43367bc7d00d6a4c7f997 (patch) | |
tree | 4bc3db8ec5d2cd174e0b1c0dc200fb9c4e28cb0c | |
parent | 23e983f2aba79f61a21eb58f16271695e047914f (diff) |
-rw-r--r-- | doc/bugs/Utility__47__libdiskfree.c_more_BSD_friendly.mdwn | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/doc/bugs/Utility__47__libdiskfree.c_more_BSD_friendly.mdwn b/doc/bugs/Utility__47__libdiskfree.c_more_BSD_friendly.mdwn new file mode 100644 index 000000000..613e11eae --- /dev/null +++ b/doc/bugs/Utility__47__libdiskfree.c_more_BSD_friendly.mdwn @@ -0,0 +1,81 @@ +### Please describe the problem. + +There exist more BSD systems than FreeBSD. Thus I propose diff for Utility/libdiskfree.c. + +Based on pkgsrc patching guidelines https://www.netbsd.org/docs/pkgsrc/components.html#components.patches.guidelines +I tried to cook a diff even I'm not C developer. + + +### What steps will reproduce the problem? + +Add support for more OS for disk free check. + +### What version of git-annex are you using? On what operating system? +git-annex-5.20150930 + + +### Please provide any additional information below. + +The diff probably needs check, improvement... + +[[!format sh """ +--- libdiskfree.c.orig Sun Oct 4 15:18:07 2015 ++++ libdiskfree.c Sun Oct 4 15:23:23 2015 +@@ -7,35 +7,30 @@ + + /* Include appropriate headers for the OS, and define what will be used to + * check the free space. */ +-#if defined(__APPLE__) +-# define _DARWIN_FEATURE_64_BIT_INODE 1 +-# include <sys/param.h> +-# include <sys/mount.h> +-# define STATCALL statfs +-# define STATSTRUCT statfs64 +-#else +-#if defined (__FreeBSD__) +-# include <sys/param.h> +-# include <sys/mount.h> +-# define STATCALL statfs /* statfs64 not yet tested on a real FreeBSD machine */ +-# define STATSTRUCT statfs +-#else +-#if defined __ANDROID__ +-# warning free space checking code not available for Android +-# define UNKNOWN +-#else + #if defined (__linux__) || defined (__FreeBSD_kernel__) + /* Linux or Debian kFreeBSD */ + /* This is a POSIX standard, so might also work elsewhere too. */ + # include <sys/statvfs.h> + # define STATCALL statvfs + # define STATSTRUCT statvfs +-#else +-# warning free space checking code not available for this OS ++#endif ++ ++#if defined __ANDROID__ ++# warning free space checking code not available for Android + # define UNKNOWN + #endif ++ ++#if defined (HAVE_SYS_PARAM_H) && defined (HAVE_SYS_MOUNT_H) ++#if defined(__APPLE__) ++# define _DARWIN_FEATURE_64_BIT_INODE 1 + #endif +-#endif ++# include <sys/param.h> ++# include <sys/mount.h> ++# define STATCALL statfs /* statfs64 not yet tested on a real FreeBSD machine */ ++# define STATSTRUCT statfs64 ++#else ++# warning free space checking code not available for this OS ++# define UNKNOWN + #endif + + #include <errno.h> + +"""]] + +### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders) + +Not tested this "feature" yet, I got another issue which blocks me for now. + |