9
0
Fork 0

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>
This commit is contained in:
Nishanth Menon 2008-12-04 21:56:33 -06:00 committed by Sascha Hauer
parent 41f4253b6c
commit 2af143fcf2
1 changed files with 1 additions and 1 deletions

View File

@ -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;