stat() can give an error, handle that

This commit is contained in:
Dana Jansens 2010-04-16 11:41:13 -04:00 committed by Mikael Magnusson
parent 34178097d5
commit 3afa20de54

View file

@ -331,7 +331,8 @@ static inline gboolean try_exec(const ObtPaths *const p,
struct stat st;
BSEARCH_SETUP(guint);
stat(path, &st);
if (stat(path, &st) != 0)
return FALSE;
if (!S_ISREG(st.st_mode))
return FALSE;