*
* The 'struct stat *st' must point to a structure that has already
* been initialized for 'path' by calling stat().
*
* The 'struct stat *st' must point to a structure that has already
* been initialized for 'path' by calling stat().
notmuch_status_t status, ret = NOTMUCH_STATUS_SUCCESS;
notmuch_message_t *message = NULL;
struct dirent **namelist = NULL;
int num_entries;
notmuch_status_t status, ret = NOTMUCH_STATUS_SUCCESS;
notmuch_message_t *message = NULL;
struct dirent **namelist = NULL;
int num_entries;
num_entries = scandir (path, &namelist, 0, ino_cmp);
if (num_entries == -1) {
num_entries = scandir (path, &namelist, 0, ino_cmp);
if (num_entries == -1) {
/* If this directory hasn't been modified since the last
* add_files, then we only need to look further for
* sub-directories. */
/* If this directory hasn't been modified since the last
* add_files, then we only need to look further for
* sub-directories. */
if (S_ISREG (st->st_mode)) {
/* If the file hasn't been modified since the last
* add_files, then we need not look at it. */
if (S_ISREG (st->st_mode)) {
/* If the file hasn't been modified since the last
* add_files, then we need not look at it. */
- status = notmuch_database_set_timestamp (notmuch, path, path_mtime);
- if (status && ret == NOTMUCH_STATUS_SUCCESS)
- ret = status;
+ if (! interrupted) {
+ status = notmuch_directory_set_mtime (directory, fs_mtime);
+ if (status && ret == NOTMUCH_STATUS_SUCCESS)
+ ret = status;
+ }
/* This is the top-level entry point for add_files. It does a couple
* of error checks, sets up the progress-printing timer and then calls
* into the recursive function. */
/* This is the top-level entry point for add_files. It does a couple
* of error checks, sets up the progress-printing timer and then calls
* into the recursive function. */
add_files (notmuch_database_t *notmuch,
const char *path,
add_files_state_t *state)
add_files (notmuch_database_t *notmuch,
const char *path,
add_files_state_t *state)