Browse Source

print file opening error

David Mazieres 3 years ago
parent
commit
05290a10f1
2 changed files with 7 additions and 0 deletions
  1. 4
    0
      notmuch_db.cc
  2. 3
    0
      sql_db.cc

+ 4
- 0
notmuch_db.cc View File

@@ -60,7 +60,11 @@ notmuch_db::add_message(const string &path, const tags_t *newtags,
60 60
 {
61 61
   notmuch_status_t err;
62 62
   notmuch_message_t *message;
63
+#if LIBNOTMUCH_CHECK_VERSION(5,1,0)
64
+  err = notmuch_database_index_file(notmuch(), path.c_str(), nullptr, &message);
65
+#else // libnotmuch < 5.1.0
63 66
   err = notmuch_database_add_message(notmuch(), path.c_str(), &message);
67
+#endif // libnotmuch < 5.1.0
64 68
   if (err != NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) {
65 69
     nmtry("notmuch_database_add_message", err);
66 70
     set_tags(message, newtags ? *newtags : new_tags);

+ 3
- 0
sql_db.cc View File

@@ -1,4 +1,5 @@
1 1
 
2
+#include <cstring>
2 3
 #include <functional>
3 4
 #include <iomanip>
4 5
 #include <iostream>
@@ -443,6 +444,8 @@ hash_lookup::content()
443 444
     if (content_.is_open())
444 445
       return content_.rdbuf();
445 446
   }
447
+  if (opt_verbose > 1 && nlinks() > 0)
448
+    cerr << link_path(nlinks()-1) << ": " << strerror(errno) << "\n";
446 449
   return nullptr;
447 450
 }
448 451
 

Loading…
Cancel
Save