]> git.notmuchmail.org Git - notmuch/commit
new: Centralize file type stat-ing logic
authorAustin Clements <amdragon@MIT.EDU>
Thu, 24 May 2012 22:01:11 +0000 (18:01 -0400)
committerDavid Bremner <bremner@debian.org>
Fri, 25 May 2012 00:53:08 +0000 (21:53 -0300)
commitd99270c450d8f9ef3ecfbcbeeb99b581f36c9175
treed68232b1f713e7de0b108452977be0bbedc02294
parent72c944655f9bc29809dc2f64d206d942d2198f6f
new: Centralize file type stat-ing logic

This moves our logic to get a file's type into one function.  This has
several benefits: we can support OSes and file systems that do not
provide dirent.d_type or always return DT_UNKNOWN, complex
symlink-handling logic has been replaced by a simple stat fall-through
in one place, and the error message for un-stat-able file is more
accurate (previously, the error always mentioned directories, even
though a broken symlink is not a directory).
notmuch-new.c
test/new