core-util: avoid calling fchmod if already right mode
authorJulien Isorce <julien.isorce@gmail.com>
Sat, 10 Oct 2015 19:11:21 +0000 (20:11 +0100)
committerArun Raghavan <git@arunraghavan.net>
Mon, 19 Oct 2015 03:23:40 +0000 (08:53 +0530)
fchmod is denied in chromium sandbox.

src/pulsecore/core-util.c

index 278ad63..2099686 100644 (file)
@@ -343,7 +343,7 @@ again:
 #endif
 
 #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);
         goto fail;
     };