aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2009-05-04 16:19:16 +0200
committerHarald Hoyer <harald@redhat.com>2009-05-04 16:19:16 +0200
commitc03da3323fb88bce8f4978a8a4ca849b1f31298d (patch)
tree934c0e080a613428ddb0b52840b37fce9887629b
parentac34bb846b983eee9f59408ef635366ad618f2e7 (diff)
downloadinitscripts-c03da3323fb88bce8f4978a8a4ca849b1f31298d.tar
initscripts-c03da3323fb88bce8f4978a8a4ca849b1f31298d.tar.gz
initscripts-c03da3323fb88bce8f4978a8a4ca849b1f31298d.tar.bz2
initscripts-c03da3323fb88bce8f4978a8a4ca849b1f31298d.tar.xz
initscripts-c03da3323fb88bce8f4978a8a4ca849b1f31298d.zip
specifiy mode for O_CREAT
-rw-r--r--src/rename_device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rename_device.c b/src/rename_device.c
index 36d8d32e..362b23f0 100644
--- a/src/rename_device.c
+++ b/src/rename_device.c
@@ -365,7 +365,8 @@ void take_lock() {
int lockfd;
while (1) {
- lockfd = open(LOCKFILE, O_RDWR|O_CREAT|O_EXCL);
+ lockfd = open(LOCKFILE, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+
if (lockfd != -1) {
write(lockfd,"%d\n",getpid());
close(lockfd);