summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-08-06 09:56:08 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-08-06 09:56:08 +0200
commitbc22ed879c05836e0f1d5e40f0f4a052d1f9d511 (patch)
tree43cc2c754bc9a18913b4bbb37a440446762cfa3b /tools.c
parent068e17303c93dcca4521a8f9c09eb7b8a4dc5104 (diff)
downloadvdr-bc22ed879c05836e0f1d5e40f0f4a052d1f9d511.tar.gz
vdr-bc22ed879c05836e0f1d5e40f0f4a052d1f9d511.tar.bz2
Files and directories are now created with rights according to the shell's umask settings
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools.c b/tools.c
index 55612165..ca4b0b80 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.95 2005/05/29 10:18:26 kls Exp $
+ * $Id: tools.c 1.96 2005/08/06 09:53:21 kls Exp $
*/
#include "tools.h"
@@ -308,7 +308,7 @@ bool MakeDirs(const char *FileName, bool IsDirectory)
struct stat fs;
if (stat(s, &fs) != 0 || !S_ISDIR(fs.st_mode)) {
dsyslog("creating directory %s", s);
- if (mkdir(s, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == -1) {
+ if (mkdir(s, ACCESSPERMS) == -1) {
LOG_ERROR_STR(s);
result = false;
break;
@@ -451,7 +451,7 @@ bool SpinUpDisk(const char *FileName)
if (access(buf, F_OK) != 0) { // the file does not exist
timeval tp1, tp2;
gettimeofday(&tp1, NULL);
- int f = open(buf, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ int f = open(buf, O_WRONLY | O_CREAT, DEFFILEMODE);
// O_SYNC doesn't work on all file systems
if (f >= 0) {
if (fdatasync(f) < 0)
@@ -843,7 +843,7 @@ bool cLockFile::Lock(int WaitSeconds)
if (f < 0 && fileName) {
time_t Timeout = time(NULL) + WaitSeconds;
do {
- f = open(fileName, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+ f = open(fileName, O_WRONLY | O_CREAT | O_EXCL, DEFFILEMODE);
if (f < 0) {
if (errno == EEXIST) {
struct stat fs;