summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2008-12-04 21:56:33 -0600
committerSascha Hauer <s.hauer@pengutronix.de>2008-12-09 11:25:54 +0100
commit2af143fcf2aee37f9596d66c1b1d4b148aa43348 (patch)
treeb0bb9b8c82670fb5c75d82bd42d5e88e8208b32e /common
parent41f4253b6c9c8bd8dc2e1abe97dec7d061bb97c2 (diff)
downloadbarebox-2af143fcf2aee37f9596d66c1b1d4b148aa43348.tar.gz
barebox-2af143fcf2aee37f9596d66c1b1d4b148aa43348.tar.xz
common:environment: fix mode requirement
Issue: Compiling on Ubuntu 8.10 Fails: inlined from 'envfs_save' at scripts/../common/environment.c:135: /usr/include/bits/fcntl2.h:51: error: call to '_open_missing_mod' declared with attribute error: open with O_CREAT in second argument needs 3 arguments Usage: open(filename, O_WRONLY | O_CREAT) Fix: When using open with O_CREAT, it requires mode to be defined. Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'common')
-rw-r--r--common/environment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/environment.c b/common/environment.c
index 29b03e17d8..c314d7cccc 100644
--- a/common/environment.c
+++ b/common/environment.c
@@ -132,7 +132,7 @@ int envfs_save(char *filename, char *dirname)
super->crc = ENVFS_32(crc32(0, buf + sizeof(struct envfs_super), size));
super->sb_crc = ENVFS_32(crc32(0, buf, sizeof(struct envfs_super) - 4));
- envfd = open(filename, O_WRONLY | O_CREAT);
+ envfd = open(filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
if (envfd < 0) {
printf("Open %s %s\n", filename, errno_str());
ret = envfd;