--- gnucash-2.2.2-orig/src/backend/file/gnc-backend-file.c	2007-12-16 21:19:10.000000000 +0100
+++ gnucash-2.2.2-sshfs-patch/src/backend/file/gnc-backend-file.c	2008-03-18 12:54:33.000000000 +0100
@@ -144,7 +144,7 @@
     if (rc)
     {
         /* If hard links aren't supported, just allow the lock. */
-        if (errno == EPERM
+        if (errno == EPERM || errno == ENOSYS
 # ifdef EOPNOTSUPP
 	    || errno == EOPNOTSUPP
 # endif
@@ -404,7 +404,7 @@
     if(err_ret != 0)
     {
 #ifdef HAVE_LINK
-        if(errno == EPERM
+        if(errno == EPERM || errno == ENOSYS
 # ifdef EOPNOTSUPP
 	   || errno == EOPNOTSUPP
 # endif
@@ -634,6 +634,7 @@
             case ENOENT:     /* tmp_name doesn't exist?  Assume "RO" error */
             case EACCES:
             case EPERM:
+            case ENOSYS:
             case EROFS:
               be_err = ERR_BACKEND_READONLY;
               break;
