[notmuch] [PATCH] Add post-add and post-tag hooks

Olly Betts olly at survex.com
Tue Dec 22 15:02:25 PST 2009


Tomas Carnecky writes:
> #if defined(__sun__)
> 	... sprintf, stat etc
> #else
> 	(void) path;
> 	return dirent->d_type == DT_DIR;
> #endif

Rather than a platform-specific check, it would be better to check if DT_DIR
is defined.

Beware that even on Linux (where the d_type field is present), it may always
contain DT_UNKNOWN for some filesystems, so you really should check for that
case and fall back to using stat() instead.

Cheers,
    Olly



More information about the notmuch mailing list