patch-encfs_main_cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. $OpenBSD: patch-encfs_main_cpp,v 1.3 2015/05/09 12:18:24 jca Exp $
  2. --- encfs/main.cpp.orig Sun Nov 29 23:04:12 2009
  3. +++ encfs/main.cpp Thu May 7 19:19:29 2015
  4. @@ -28,6 +28,8 @@
  5. #include <cstdio>
  6. #include <unistd.h>
  7. #include <sys/time.h>
  8. +#include <sys/param.h>
  9. +#include <sys/mount.h>
  10. #include <cerrno>
  11. #include <cstring>
  12. @@ -51,11 +53,6 @@
  13. #include "openssl.h"
  14. -// Fuse version >= 26 requires another argument to fuse_unmount, which we
  15. -// don't have. So use the backward compatible call instead..
  16. -extern "C" void fuse_unmount_compat22(const char *mountpoint);
  17. -# define fuse_unmount fuse_unmount_compat22
  18. -
  19. #include <locale.h>
  20. #include "i18n.h"
  21. @@ -756,7 +753,11 @@ static bool unmountFS(EncFS_Context *ctx)
  22. // xgroup(diag)
  23. rWarning(_("Unmounting filesystem %s due to inactivity"),
  24. arg->mountPoint.c_str());
  25. - fuse_unmount( arg->mountPoint.c_str() );
  26. + if (unmount( arg->mountPoint.c_str(), MNT_FORCE ) != 0)
  27. + {
  28. + rWarning(_("Unmounting filesystem %s failed: %s"),
  29. + arg->mountPoint.c_str(), strerror(errno) );
  30. + }
  31. return true;
  32. }
  33. }