summaryrefslogtreecommitdiffstats
path: root/libmount/src/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmount/src/lock.c')
-rw-r--r--libmount/src/lock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmount/src/lock.c b/libmount/src/lock.c
index 06eff1344..f9d0253fb 100644
--- a/libmount/src/lock.c
+++ b/libmount/src/lock.c
@@ -220,6 +220,11 @@ static int lock_simplelock(struct libmnt_lock *ml)
rc = -errno;
goto err;
}
+ rc = fchmod(ml->lockfile_fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+ if (rc < 0) {
+ rc = -errno;
+ goto err;
+ }
while (flock(ml->lockfile_fd, LOCK_EX) < 0) {
int errsv;