From a56a38631847d35aa4f7ea3c9ae445617dcdc7f8 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Fri, 10 Mar 2006 09:36:43 +0000 Subject: [PATCH] Check for errno macro EOPNOTSUPP only if it is defined git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13578 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/backend/file/gnc-backend-file.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backend/file/gnc-backend-file.c b/src/backend/file/gnc-backend-file.c index a3d14c90f9..ffb1599604 100644 --- a/src/backend/file/gnc-backend-file.c +++ b/src/backend/file/gnc-backend-file.c @@ -129,7 +129,11 @@ gnc_file_be_get_file_lock (FileBackend *be) if (rc) { /* If hard links aren't supported, just allow the lock. */ - if (errno == EOPNOTSUPP || errno == EPERM) + if (errno == EPERM +#ifdef EOPNOTSUPP + || errno == EOPNOTSUPP +#endif + ) { be->linkfile = NULL; return TRUE; @@ -336,7 +340,11 @@ gnc_int_link_or_make_backup(FileBackend *be, const char *orig, const char *bkup) int err_ret = link(orig, bkup); if(err_ret != 0) { - if(errno == EPERM || errno == EOPNOTSUPP) + if(errno == EPERM +#ifdef EOPNOTSUPP + || errno == EOPNOTSUPP +#endif + ) { err_ret = copy_file(orig, bkup); }