From df1ed6f83043b7290d27b49c3c63fc8bcb796d5c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 20 Sep 2008 03:39:43 -0700 Subject: Oops, open() with O_CREAT is nicer with a mode Respect the user's umask (and the number of the beast!) --- src/state_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/state_file.c') diff --git a/src/state_file.c b/src/state_file.c index b7f28e538..365baec0f 100644 --- a/src/state_file.c +++ b/src/state_file.c @@ -55,7 +55,7 @@ void write_state_file(void) if (!sfpath) return; - while (((fd = open(sfpath, O_WRONLY|O_TRUNC|O_CREAT)) < 0) && + while (((fd = open(sfpath, O_WRONLY|O_TRUNC|O_CREAT, 0666)) < 0) && errno == EINTR); if (fd < 0) { ERROR("problems opening state file \"%s\" for writing: %s\n", -- cgit v1.2.3