1
0
Fork 0
forked from len0rd/rockbox

Make open() posix compliant api-wise. A few calls (those with O_CREAT) need the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2010-05-06 17:35:13 +00:00
parent c61e89c0ed
commit 0a1d7c28b7
76 changed files with 179 additions and 122 deletions

View file

@ -336,7 +336,7 @@ static void flush_buffer(void* data)
if (in_usb_mode || (buf_idx == 0))
return;
fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND);
fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND, 0666);
if (fd < 0)
return;
@ -446,7 +446,7 @@ void thread(void)
rb->unregister_storage_idle_func(flush_buffer, true);
/* log end of bench and exit reason */
fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND);
fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND, 0666);
if (fd >= 0)
{
rb->fdprintf(fd, "--Battery bench ended, reason: %s--\n", exit_reason);
@ -525,7 +525,7 @@ int main(void)
fd = rb->open(BATTERY_LOG, O_RDONLY);
if (fd < 0)
{
fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT);
fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT, 0666);
if (fd >= 0)
{
rb->fdprintf(fd,

View file

@ -871,7 +871,7 @@ static void blackjack_savegame(struct game_context* bj) {
if(!resume)
return;
/* write out the game state to the save file */
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT);
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT, 0666);
if(fd < 0)
return;
rb->write(fd, bj, sizeof(struct game_context));

View file

@ -1265,7 +1265,7 @@ static void brickmania_savegame(void)
int fd;
/* write out the game state to the save file */
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT);
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT, 0666);
if(fd < 0) return;
if ((rb->write(fd, &pad_pos_x, sizeof(pad_pos_x)) <= 0) ||

View file

@ -2212,7 +2212,7 @@ static void bubbles_savedata(void) {
if (last_highlevel >= highlevel) /* no need to save */
return;
fd = rb->open(DATA_FILE, O_WRONLY|O_CREAT);
fd = rb->open(DATA_FILE, O_WRONLY|O_CREAT, 0666);
if (fd < 0) return;
rb->write(fd, &highlevel, sizeof(highlevel));
@ -2252,7 +2252,7 @@ static void bubbles_savegame(struct game_context* bb) {
if (!resume) /* nothing to save */
return;
/* write out the game state to the save file */
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT);
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT, 0666);
if (fd < 0)
{
rb->splash(HZ/2, "Failed to save game");

View file

@ -611,7 +611,7 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown)
{
int fp, fq;
/* use O_RDWR|O_CREAT so that file is created if it doesn't exist. */
fp = rb->open(MEMO_FILE, O_RDWR|O_CREAT);
fp = rb->open(MEMO_FILE, O_RDWR|O_CREAT, 0666);
fq = rb->creat(TEMP_FILE, 0666);
if ( (fq > -1) && (fp > -1) )
{

View file

@ -275,7 +275,7 @@ void cb_saveposition ( void ) {
rb->splash ( 0 , "Saving position" );
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT);
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT, 0666);
computer++; rb->write(fd, &(computer), sizeof(computer)); computer--;
opponent++; rb->write(fd, &(opponent), sizeof(opponent)); opponent--;

View file

@ -670,7 +670,7 @@ void pgn_parse_game(const char* filename,
rb->read_line(fhandler, line_buffer, sizeof line_buffer);
}
loghandler = rb->open(LOG_FILE, O_WRONLY | O_CREAT);
loghandler = rb->open(LOG_FILE, O_WRONLY | O_CREAT, 0666);
GNUChess_Initialize();
@ -829,7 +829,7 @@ void pgn_store_game(struct pgn_game_node* game){
ply_count++;
}
fhandler = rb->open(PGN_FILE, O_WRONLY|O_CREAT|O_APPEND);
fhandler = rb->open(PGN_FILE, O_WRONLY|O_CREAT|O_APPEND, 0666);
/* the first 7 tags are mandatory according to the PGN specification so we

View file

@ -246,7 +246,7 @@ enum plugin_status plugin_start(const void* parameter)
memcpy(buf + 1, "nn2x", 4);
/* 4 - Write to disk */
fd = rb->open(outputfilename,O_WRONLY|O_CREAT|O_TRUNC);
fd = rb->open(outputfilename,O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fd < 0) {
rb->splash(HZ*2, "Could not open output file");
@ -307,7 +307,7 @@ enum plugin_status plugin_start(const void* parameter)
memcpy(buf + 1, "nn2g", 4);
/* 4 - Write to disk */
fd = rb->open(outputfilename,O_WRONLY|O_CREAT|O_TRUNC);
fd = rb->open(outputfilename,O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fd < 0) {
rb->splash(HZ*2, "Could not open output file");

View file

@ -63,13 +63,20 @@ int fileexists(const char * fname)
}
#ifndef SIMULATOR
int my_open(const char *file, int flags)
int my_open(const char *file, int flags, ...)
{
if(fpoint==8)
return -1;
#undef open
filearray[fpoint]=rb->open(file, flags);
if (flags & O_CREAT)
{
va_list ap;
va_start(ap, flags);
filearray[fpoint]=rb->open(file, flags, va_arg(ap, mode_t));
va_end(ap);
}
else
filearray[fpoint]=rb->open(file, flags);
if(filearray[fpoint]<0)
return filearray[fpoint];

View file

@ -39,12 +39,12 @@ char *my_strtok( char * s, const char * delim );
#define read_line(a,b,c) rb->read_line((a),(b),(c))
#ifdef SIMULATOR
#define open(a,b) rb->open((a),(b))
#define open(a, ...) rb->open((a), __VA_ARGS__)
#define close(a) rb->close((a))
#else
int my_open(const char *file, int flags);
int my_open(const char *file, int flags, ...);
int my_close(int id);
#define open(a,b) my_open((a),(b))
#define open(a, ...) my_open((a), __VA_ARGS__)
#define close(a) my_close((a))
#endif

View file

@ -837,7 +837,7 @@ void z_save (void)
/* Open auxilary file */
if ((gfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC)) < 0)
if ((gfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
goto finished;
/* Write auxilary file */
@ -859,7 +859,7 @@ void z_save (void)
/* Open game file */
if ((gfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC)) < 0)
if ((gfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
goto finished;
success = save_quetzal (gfp, story_fp);

View file

@ -74,7 +74,7 @@ void script_open (void)
/* Opening in "at" mode doesn't work for script_erase_input... */
if ((sfp = rb->open (script_name, O_RDWR|O_CREAT)) != -1) {
if ((sfp = rb->open (script_name, O_RDWR|O_CREAT, 0666)) != -1) {
fseek (sfp, 0, SEEK_END);
@ -290,7 +290,7 @@ void record_open (void)
strcpy (command_name, new_name);
if ((rfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC)) != -1)
if ((rfp = rb->open (new_name, O_WRONLY|O_CREAT|O_TRUNC, 0666)) != -1)
ostream_record = TRUE;
else
print_string ("Cannot open file\n");

View file

@ -498,7 +498,7 @@ static void jewels_savegame(struct game_context* bj)
{
int fd;
/* write out the game state to the save file */
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT);
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT, 0666);
if(fd < 0) return;
rb->write(fd, &bj->tmp_type, sizeof(bj->tmp_type));

View file

@ -584,7 +584,7 @@ static int keybox(void)
if (data_changed)
{
fd = rb->open(KEYBOX_FILE, O_WRONLY | O_CREAT | O_TRUNC);
fd = rb->open(KEYBOX_FILE, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd < 0)
return FILE_OPEN_ERROR;
write_output(fd);

View file

@ -33,7 +33,7 @@ int highscore_save(char *filename, struct highscore *scores, int num_scores)
if(!highscore_updated)
return 1;
fd = rb->open(filename, O_WRONLY|O_CREAT);
fd = rb->open(filename, O_WRONLY|O_CREAT, 0666);
if(fd < 0)
return -1;

View file

@ -158,7 +158,7 @@ static int io_open (lua_State *L) {
}
if((*mode == 'w' || *mode == 'a') && !rb->file_exists(filename))
flags |= O_CREAT;
*pf = rb->open(filename, flags);
*pf = rb->open(filename, flags, 0666);
return (*pf < 0) ? pushresult(L, 0, filename) : 1;
}

View file

@ -246,7 +246,7 @@ enum plugin_status plugin_start(const void* parameter)
done = 0;
action( out, arg );
out = rb->open( filename, O_WRONLY|O_CREAT|O_TRUNC );
out = rb->open( filename, O_WRONLY|O_CREAT|O_TRUNC , 0666);
if( out < 0 ) return PLUGIN_ERROR;
action( out, arg );
rb->close( out );

View file

@ -2598,7 +2598,7 @@ enum plugin_status plugin_start(const void* parameter)
{
init_mp3_encoder_engine(true, brate[srat], cfg.samplerate);
get_mp3_filename(wav_filename);
mp3file = rb->open(mp3_name , O_WRONLY|O_CREAT|O_TRUNC);
mp3file = rb->open(mp3_name , O_WRONLY|O_CREAT|O_TRUNC, 0666);
frames = 0;
tim = *rb->current_tick;

View file

@ -91,11 +91,7 @@ static void sfwrite_open(t_sfwrite *x,t_symbol *filename)
sfwrite_close(x);
#ifdef ROCKBOX
if ((x->x_file = open(fname, O_RDWR | O_CREAT)) < 0)
#else
if ((x->x_file = open(fname,O_RDWR | O_CREAT,0664)) < 0)
#endif
{
error("can't create %s",fname);
return;

View file

@ -1306,7 +1306,7 @@ static void garray_write(t_garray *x, t_symbol *filename)
buf, MAXPDSTRING);
sys_bashfilename(buf, buf);
#ifdef ROCKBOX
if(!(fd = open(buf, O_WRONLY|O_CREAT|O_TRUNC)))
if(!(fd = open(buf, O_WRONLY|O_CREAT|O_TRUNC, 0666)))
#else
if (!(fd = fopen(buf, "w")))
#endif
@ -1388,7 +1388,7 @@ static void garray_write16(t_garray *x, t_symbol *filename, t_symbol *format)
buf2, MAXPDSTRING);
sys_bashfilename(buf2, buf2);
#ifdef ROCKBOX
if(!(fd = open(buf2, O_WRONLY|O_CREAT|O_TRUNC)))
if(!(fd = open(buf2, O_WRONLY|O_CREAT|O_TRUNC, 0666)))
#else
if (!(fd = fopen(buf2, BINWRITEMODE)))
#endif

View file

@ -214,7 +214,7 @@ void generate(void)
{
dirs_count = 0;
abort = false;
fd = rb->open(RFA_FILE,O_CREAT|O_WRONLY);
fd = rb->open(RFA_FILE,O_CREAT|O_WRONLY, 0666);
rb->write(fd,&dirs_count,sizeof(int));
if (fd < 0)
{

View file

@ -877,7 +877,7 @@ static void dump_resume(void)
{
int fd;
fd = rb->open(RESUME_FILE, O_WRONLY|O_CREAT);
fd = rb->open(RESUME_FILE, O_WRONLY|O_CREAT, 0666);
if (fd < 0)
goto fail;

View file

@ -947,7 +947,7 @@ next:
int fd;
blockcount++;
snprintf(meow,499,"/dyna_0x%x_run.rb",PC);
fd=open(meow,O_WRONLY|O_CREAT|O_TRUNC);
fd=open(meow,O_WRONLY|O_CREAT|O_TRUNC, 0666);
if(fd>=0)
{
fdprintf(fd,"Block 0x%x Blockcount: %d\n",PC,blockcount);

View file

@ -425,7 +425,7 @@ void dynamic_recompile (struct dynarec_block *newblock)
newblock->block=dynapointer;
#ifdef DYNA_DEBUG
snprintf(meow,499,"/dyna_0x%x_asm.rb",PC);
fd=open(meow,O_WRONLY|O_CREAT|O_TRUNC);
fd=open(meow,O_WRONLY|O_CREAT|O_TRUNC, 0666);
if(fd<0)
{
die("couldn't open dyna debug file");
@ -1907,7 +1907,7 @@ void dynamic_recompile (struct dynarec_block *newblock)
newblock->length=dynapointer-newblock->block;
IF_COP(rb->cpucache_invalidate());
snprintf(meow,499,"/dyna_0x%x_code.rb",PC);
fd=open(meow,O_WRONLY|O_CREAT|O_TRUNC);
fd=open(meow,O_WRONLY|O_CREAT|O_TRUNC, 0666);
if(fd>=0)
{
write(fd,newblock->block,newblock->length);

View file

@ -249,7 +249,7 @@ static int sram_save(void)
/* If we crash before we ever loaded sram, DO NOT SAVE! */
if (!mbc.batt || !ram.loaded || !mbc.ramsize)
return -1;
fd = open(sramfile, O_WRONLY|O_CREAT|O_TRUNC);
fd = open(sramfile, O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fd<0) return -1;
snprintf(meow,499,"Saving savedata to %s",sramfile);
rb->splash(HZ*2, meow);
@ -263,7 +263,7 @@ static void rtc_save(void)
{
int fd;
if (!rtc.batt) return;
if ((fd = open(rtcfile, O_WRONLY|O_CREAT|O_TRUNC))<0) return;
if ((fd = open(rtcfile, O_WRONLY|O_CREAT|O_TRUNC, 0666))<0) return;
rtc_save_internal(fd);
close(fd);
}

View file

@ -178,7 +178,7 @@ static bool do_file(char *path, char *desc, bool is_load) {
file_mode = is_load ? O_RDONLY : (O_WRONLY | O_CREAT);
/* attempt to open file descriptor here */
if ((fd = open(path, file_mode)) < 0)
if ((fd = open(path, file_mode, 0666)) < 0)
return false;
/* load/save state */

View file

@ -325,7 +325,7 @@ static void savesettings(void)
{
options.dirty=0;
snprintf(optionsave, sizeof(optionsave), "%s/%s", savedir, optionname);
fd = open(optionsave, O_WRONLY|O_CREAT|O_TRUNC);
fd = open(optionsave, O_WRONLY|O_CREAT|O_TRUNC, 0666);
write(fd,&options, sizeof(options));
close(fd);
}

View file

@ -59,7 +59,9 @@ void dynamic_recompile (struct dynarec_block *newblock);
#define isalpha(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && ((c) <= 'Z')))
#define isalnum(c) (isdigit(c) || (isalpha(c)))
#define open(a,b) rb->open((a),(b))
/* only 1 fixed argument for open, since variadic macros don't except empty
* variable parameters */
#define open(a, ...) rb->open((a), __VA_ARGS__)
#define lseek(a,b,c) rb->lseek((a),(b),(c))
#define close(a) rb->close((a))
#define read(a,b,c) rb->read((a),(b),(c))

View file

@ -123,7 +123,7 @@ static bool search_init(const char* file){
if (bomsize)
fdw = rb->open_utf8(resultfile, O_WRONLY|O_CREAT|O_TRUNC);
else
fdw = rb->open(resultfile, O_WRONLY|O_CREAT|O_TRUNC);
fdw = rb->open(resultfile, O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fdw < 0) {
#ifdef HAVE_LCD_BITMAP

View file

@ -78,7 +78,7 @@ enum plugin_status plugin_start(const void* parameter)
rb->close(parsefd);
hits=0;
if(result!=0) {
int fd=rb->open("/search.m3u", O_WRONLY|O_CREAT|O_TRUNC);
int fd=rb->open("/search.m3u", O_WRONLY|O_CREAT|O_TRUNC, 0666);
int i;
for(i=0;i<rb->tagdbheader->filecount;i++)
if(result[i]) {

View file

@ -124,7 +124,7 @@ enum plugin_status plugin_start(
int fd;
(void)parameter;
fd = rb->open(FILENAME, O_CREAT|O_TRUNC|O_WRONLY);
fd = rb->open(FILENAME, O_CREAT|O_TRUNC|O_WRONLY, 0666);
if (fd < 0)
return PLUGIN_ERROR;
list = rb->get_settings_list(&setting_count);

View file

@ -1117,7 +1117,7 @@ static bool save(char *filename, bool solution)
}
if (filename[0] == '\0' ||
(fd = rb->open(filename, O_WRONLY|O_CREAT|O_TRUNC)) < 0) {
(fd = rb->open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0) {
rb->splashf(HZ*2, "Unable to open %s", filename);
return false;
}

View file

@ -1272,7 +1272,7 @@ int open_save_file( int flags )
{
char buf[MAX_PATH];
get_save_filename( buf );
return rb->open( buf, flags );
return rb->open( buf, flags, 0666);
}
void delete_save_file( void )

View file

@ -147,7 +147,7 @@ static int write_file(void)
if (bomsize)
fd = rb->open_utf8(tmpfilename, O_WRONLY|O_CREAT|O_TRUNC);
else
fd = rb->open(tmpfilename, O_WRONLY|O_CREAT|O_TRUNC);
fd = rb->open(tmpfilename, O_WRONLY|O_CREAT|O_TRUNC, 0666);
if(fd < 0)
return 10 * fd - 1;

View file

@ -687,7 +687,7 @@ static int save(
/* write the file 1 */
if (file_name1 != NULL)
{
file1 = rb->open (file_name1, O_WRONLY | O_CREAT);
file1 = rb->open (file_name1, O_WRONLY | O_CREAT, 0666);
if (file1 >= 0)
{
int rc = copy_file(file1, src_file, end, y*2 + 1, y -1);
@ -727,7 +727,7 @@ static int save(
if (file_name2 != NULL)
{
/* write file 2 */
file2 = rb->open (file_name2, O_WRONLY | O_CREAT);
file2 = rb->open (file_name2, O_WRONLY | O_CREAT, 0666);
if (file2 >= 0)
{
end = mp3->filesize - end;

View file

@ -358,7 +358,7 @@ void save_stopwatch(void)
{
int fd;
fd = rb->open(STOPWATCH_FILE, O_CREAT|O_WRONLY|O_TRUNC);
fd = rb->open(STOPWATCH_FILE, O_CREAT|O_WRONLY|O_TRUNC, 0666);
if (fd < 0)
{

View file

@ -808,7 +808,7 @@ bool save_sudoku(struct sudoku_state_t* state)
return false;
}
fd=rb->open(state->filename, O_WRONLY|O_CREAT);
fd=rb->open(state->filename, O_WRONLY|O_CREAT, 0666);
if (fd >= 0) {
for (r=0;r<9;r++) {
i=0;

View file

@ -626,7 +626,7 @@ int save_game(void) {
return -1;
}
fd = rb->open(savepath, O_WRONLY|O_CREAT);
fd = rb->open(savepath, O_WRONLY|O_CREAT, 0666);
DEBUGF("savepath: %s\n", savepath);
if(fd < 0) {
DEBUGF("Couldn't create/open file\n");

View file

@ -59,7 +59,7 @@ static bool log_init(bool use_logfile)
if (use_logfile) {
rb->create_numbered_filename(logfilename, "/", "test_codec_log_", ".txt",
2 IF_CNFN_NUM_(, NULL));
log_fd = rb->open(logfilename, O_RDWR|O_CREAT|O_TRUNC);
log_fd = rb->open(logfilename, O_RDWR|O_CREAT|O_TRUNC, 0666);
return log_fd >= 0;
}

View file

@ -85,7 +85,7 @@ static bool log_init(void)
rb->create_numbered_filename(logfilename, "/", "test_disk_log_", ".txt",
2 IF_CNFN_NUM_(, NULL));
log_fd = rb->open(logfilename, O_RDWR|O_CREAT|O_TRUNC);
log_fd = rb->open(logfilename, O_RDWR|O_CREAT|O_TRUNC, 0666);
return log_fd >= 0;
}

View file

@ -47,7 +47,7 @@ static int log_init(void)
rb->create_numbered_filename(logfilename, "/", "test_gfx_log_", ".txt",
2 IF_CNFN_NUM_(, NULL));
fd = rb->open(logfilename, O_RDWR|O_CREAT|O_TRUNC);
fd = rb->open(logfilename, O_RDWR|O_CREAT|O_TRUNC, 0666);
return fd;
}

View file

@ -237,7 +237,7 @@ enum plugin_status plugin_start(const void* parameter)
case GREY_OK:
rb->create_numbered_filename(filename, "/", "test_grey_",
".txt", 2 IF_CNFN_NUM_(, NULL));
fd = rb->open(filename, O_RDWR|O_CREAT|O_TRUNC);
fd = rb->open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
if (fd >= 0)
{
for (i = 0; i <= STEPS; i++)

View file

@ -180,7 +180,7 @@ bool save_changes(int overwrite)
}
}
fd = rb->open(filename,O_WRONLY|O_CREAT|O_TRUNC);
fd = rb->open(filename,O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fd < 0)
{
newfile = true;

View file

@ -686,7 +686,7 @@ enum plugin_status plugin_start(const void* parameter)
case 0:
if(create_log)
{
log_fd = rb->open(LOG_FILENAME, O_WRONLY|O_CREAT|O_APPEND);
log_fd = rb->open(LOG_FILENAME, O_WRONLY|O_CREAT|O_APPEND, 0666);
if(log_fd >= 0)
rb->fdprintf(log_fd, "---- %s ----\n", title);
else

View file

@ -2138,7 +2138,7 @@ static bool viewer_load_global_settings(void)
static bool viewer_save_global_settings(void)
{
int sfd = rb->open(GLOBAL_SETTINGS_TMP_FILE, O_WRONLY|O_CREAT|O_TRUNC);
int sfd = rb->open(GLOBAL_SETTINGS_TMP_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0666);
unsigned char buf[GLOBAL_SETTINGS_H_SIZE];
if (sfd < 0)
@ -2219,7 +2219,7 @@ static bool viewer_convert_settings_file(void)
if ((sfd = rb->open(SETTINGS_FILE, O_RDONLY)) < 0)
return false;
if ((tfd = rb->open(SETTINGS_TMP_FILE, O_WRONLY|O_CREAT|O_TRUNC)) < 0)
if ((tfd = rb->open(SETTINGS_TMP_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0)
{
rb->close(sfd);
return false;
@ -2441,7 +2441,7 @@ static bool viewer_save_settings(void)
bookmarks[bookmark_count-1].flag = BOOKMARK_LAST;
}
tfd = rb->open(SETTINGS_TMP_FILE, O_WRONLY|O_CREAT|O_TRUNC);
tfd = rb->open(SETTINGS_TMP_FILE, O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (tfd < 0)
return false;

View file

@ -3492,7 +3492,7 @@ static int record_file(char *filename)
{8, 32000}, {9, 44100}, {10, 48000}
};
fd = rb->open(filename, O_RDWR|O_CREAT|O_TRUNC);
fd = rb->open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
if (fd < 0)
{
rb->splash(2*HZ, "Couldn't create WAV file");

View file

@ -223,12 +223,12 @@ void write_buf(void){
#if 0
/* can use to save and later analyze what we produce */
i = rb->open ( "/sound.raw" , O_WRONLY | O_APPEND | O_CREAT );
i = rb->open ( "/sound.raw" , O_WRONLY | O_APPEND | O_CREAT, 0666);
rb->write ( i , sp_sound_buf , TMNUM );
rb->close (i);
i = rb->open ( "/sound2.raw" , O_WRONLY | O_APPEND |O_CREAT);
i = rb->open ( "/sound2.raw" , O_WRONLY | O_APPEND |O_CREAT, 0666);
rb->write ( i , (unsigned char *)my_buf , TMNUM*4*3 );
rb->close (i);
#endif