set mode argument for open() where O_CREAT flag is/can be set.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28527 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Teruaki Kawashima 2010-11-07 11:45:20 +00:00
parent 3772a08729
commit 930a8a5050
8 changed files with 8 additions and 12 deletions

View file

@ -149,7 +149,7 @@ int main(int argc, char *argv[])
/* output raw audio frames that are sent to the decoder into separate files */
#ifdef DUMP_RAW_FRAMES
snprintf(filename,sizeof(filename),"dump%d.raw",++x);
fd_out = open(filename,O_WRONLY|O_CREAT|O_APPEND);
fd_out = open(filename,O_WRONLY|O_CREAT|O_APPEND, 0666);
write(fd_out,pkt.frames[i],sps);
close(fd_out);
#endif

View file

@ -920,7 +920,7 @@ int open_utf8(const char* pathname, int flags)
int fd;
unsigned char bom[BOM_SIZE];
fd = open(pathname, flags);
fd = open(pathname, flags, 0666);
if(fd < 0)
return fd;

View file

@ -1484,7 +1484,7 @@ void ProcessDehFile(const char *filename, const char *outfilename, int lumpnum)
if (strcmp(outfilename, "-"))
{
fileout = open(outfilename, firstfile ? O_WRONLY | O_CREAT :
O_WRONLY | O_APPEND);
O_WRONLY | O_APPEND, 0666);
if (fileout < 0)
{
printf( "Could not open -dehout file %s\n... using stdout.\n",

View file

@ -2770,7 +2770,7 @@ boolean G_CheckDemoStatus (void)
int endtime = I_GetTime ();
// killough -- added fps information and made it work for longer demos:
unsigned realtics = endtime-starttime;
int fd=open(GAMEBASE "timedemo.txt",O_WRONLY | O_CREAT);
int fd=open(GAMEBASE "timedemo.txt",O_WRONLY | O_CREAT,0666);
fdprintf (fd,"Timed %d gametics in %d realtics = %d frames per second",
(unsigned) gametic, realtics,
(unsigned) gametic * TICRATE/ realtics);

View file

@ -96,7 +96,7 @@ boolean M_WriteFile(char const* name,void* source,int length)
int handle;
int count;
handle = open ( name, O_WRONLY | O_CREAT | O_TRUNC);
handle = open ( name, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (handle == -1)
return false;
@ -805,7 +805,7 @@ void M_SaveDefaults (void)
uint32_t magic = DOOM_CONFIG_MAGIC;
uint32_t ver = DOOM_CONFIG_VERSION;
fd = open (GAMEBASE"default.dfg", O_WRONLY|O_CREAT|O_TRUNC);
fd = open (GAMEBASE"default.dfg", O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fd<0)
return; // can't write the file, but don't complain

View file

@ -721,7 +721,7 @@ cache;
// Use cached translucency filter if it's available
if ((cachefd<0) ? cachefd = open(GAMEBASE"tranmap.dat",O_WRONLY | O_CREAT) , 1 :
if ((cachefd<0) ? cachefd = open(GAMEBASE"tranmap.dat",O_WRONLY | O_CREAT, 0666) , 1 :
read(cachefd, &cache, sizeof(cache)) != sizeof(cache) ||
cache.pct != tran_filter_pct ||
memcmp(cache.playpal, playpal, sizeof cache.playpal) ||

View file

@ -727,11 +727,7 @@ static int create_soundfile(t_canvas *canvas, const char *filename,
canvas_makefilename(canvas, filenamebuf, buf2, MAXPDSTRING);
sys_bashfilename(buf2, buf2);
#ifdef ROCKBOX
if ((fd = open(buf2, BINCREATE)) < 0)
#else
if ((fd = open(buf2, BINCREATE, 0666)) < 0)
#endif
return (-1);
if (write(fd, headerbuf, headersize) < headersize)

View file

@ -641,7 +641,7 @@ static int binbuf_doopen(char *s, int mode)
mode |= O_BINARY;
#endif
sys_bashfilename(s, namebuf);
return (open(namebuf, mode));
return (open(namebuf, mode, 0666));
}
#ifndef ROCKBOX