From 2af143fcf2aee37f9596d66c1b1d4b148aa43348 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Thu, 4 Dec 2008 21:56:33 -0600 Subject: 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 --- common/environment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') 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; -- cgit v1.2.3