core-util: avoid calling fchmod if already right mode

fchmod is denied in chromium sandbox.
This commit is contained in:
Julien Isorce 2015-10-10 20:11:21 +01:00 committed by Arun Raghavan
parent 336a2cc6f0
commit c021bfc6e0

View file

@ -343,7 +343,7 @@ again:
#endif #endif
#ifdef HAVE_FCHMOD #ifdef HAVE_FCHMOD
if (fchmod(fd, m) < 0) { if ((st.st_mode & 07777) != m && fchmod(fd, m) < 0) {
pa_assert_se(pa_close(fd) >= 0); pa_assert_se(pa_close(fd) >= 0);
goto fail; goto fail;
}; };