forked from len0rd/rockbox
Removed 'mode' parameter from creat(). It wasn't pure posix anyway, it was ignored on target and mixed into 'oflags' in the simulator. * Simplified io.c a bit by defining a dummy O_BINARY for OSes which don't have that.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12179 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
98dc093317
commit
67eb154146
26 changed files with 53 additions and 57 deletions
|
|
@ -316,7 +316,7 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown)
|
|||
{
|
||||
int fp,fq;
|
||||
fp = rb->open("/.rockbox/.memo",O_RDONLY | O_CREAT);
|
||||
fq = rb->creat("/.rockbox/~temp", O_WRONLY);
|
||||
fq = rb->creat("/.rockbox/~temp");
|
||||
if ( (fq != -1) && (fp != -1) )
|
||||
{
|
||||
int i;
|
||||
|
|
@ -345,7 +345,7 @@ static bool save_memo(int changed, bool new_mod, struct shown *shown)
|
|||
rb->write(fq,temp,1);
|
||||
}
|
||||
rb->close(fp);
|
||||
fp = rb->creat("/.rockbox/.memo", O_WRONLY);
|
||||
fp = rb->creat("/.rockbox/.memo");
|
||||
rb->lseek(fp, 0, SEEK_SET);
|
||||
rb->lseek(fq, 0, SEEK_SET);
|
||||
for (i = 0; i < rb->filesize(fq); i++)
|
||||
|
|
|
|||
|
|
@ -903,7 +903,7 @@ void save_settings(bool interface)
|
|||
rb->lcd_update();
|
||||
}
|
||||
|
||||
fd = rb->creat(default_filename, O_WRONLY); /* create the settings file */
|
||||
fd = rb->creat(default_filename); /* create the settings file */
|
||||
|
||||
if(fd >= 0) /* file exists, save successful */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ static int write_file(void)
|
|||
|
||||
rb->snprintf(tmpfilename, MAX_PATH+1, "%s.tmp", filename);
|
||||
|
||||
fd = rb->creat(tmpfilename, O_WRONLY);
|
||||
fd = rb->creat(tmpfilename);
|
||||
if(fd < 0)
|
||||
return 10 * fd - 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ int save_bmp_file( char* filename, struct bitmap *bm, struct plugin_api* rb )
|
|||
int fh;
|
||||
int x,y;
|
||||
if( bm->format != FORMAT_NATIVE ) return -1;
|
||||
fh = rb->PREFIX(creat)( filename, O_WRONLY );
|
||||
fh = rb->creat( filename );
|
||||
if( fh < 0 ) return -1;
|
||||
|
||||
rb->write( fh, header, sizeof( header ) );
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ int configfile_save(const char *filename, struct configdata *cfg,
|
|||
char buf[MAX_PATH];
|
||||
|
||||
cfg_rb->snprintf(buf, MAX_PATH, "/.rockbox/rocks/%s", filename);
|
||||
fd = cfg_rb->creat(buf, O_WRONLY);
|
||||
fd = cfg_rb->creat(buf);
|
||||
if(fd < 0)
|
||||
return fd*10 - 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ static bool search_init(char* file)
|
|||
if (fd==-1)
|
||||
return false;
|
||||
|
||||
fdw = rb->creat(resultfile, O_WRONLY);
|
||||
fdw = rb->creat(resultfile);
|
||||
|
||||
if (fdw < 0) {
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ static int write_file(void)
|
|||
|
||||
/* Create a temporary file */
|
||||
rb->snprintf(tmpfilename, MAX_PATH+1, "%s.tmp", filename);
|
||||
fd = rb->creat(tmpfilename, O_WRONLY);
|
||||
fd = rb->creat(tmpfilename);
|
||||
if(fd < 0)
|
||||
return 10 * fd - 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ static bool test_fs(void)
|
|||
rb->snprintf(text_buf, sizeof text_buf, "FS stress test: %dKB", (TEST_SIZE>>10));
|
||||
log_lcd(text_buf, true);
|
||||
|
||||
fd = rb->creat(TEST_FILE, 0);
|
||||
fd = rb->creat(TEST_FILE);
|
||||
if (fd < 0)
|
||||
{
|
||||
rb->splash(0, true, "Couldn't create testfile.");
|
||||
|
|
@ -193,7 +193,7 @@ static bool test_speed(void)
|
|||
log_init();
|
||||
log_lcd("Disk speed test", true);
|
||||
|
||||
fd = rb->creat(TEST_FILE, 0);
|
||||
fd = rb->creat(TEST_FILE);
|
||||
if (fd < 0)
|
||||
{
|
||||
rb->splash(0, true, "Couldn't create testfile.");
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes)
|
|||
return 10*orig_fd - 1;
|
||||
}
|
||||
|
||||
fd = rb->creat(tmpname, O_WRONLY);
|
||||
fd = rb->creat(tmpname);
|
||||
if(fd < 0) {
|
||||
rb->close(orig_fd);
|
||||
return 10*fd - 2;
|
||||
|
|
|
|||
|
|
@ -1074,7 +1074,7 @@ static void viewer_load_settings(void) /* same name as global, but not the same
|
|||
if (i < data->bookmarked_files_count)
|
||||
{
|
||||
/* it is in the list, write everything back in the correct order, and reload the file correctly */
|
||||
settings_fd = rb->creat(BOOKMARKS_FILE, O_WRONLY);
|
||||
settings_fd = rb->creat(BOOKMARKS_FILE);
|
||||
if (settings_fd >=0 )
|
||||
{
|
||||
if (data->bookmarked_files_count > MAX_BOOKMARKED_FILES)
|
||||
|
|
@ -1092,7 +1092,7 @@ static void viewer_load_settings(void) /* same name as global, but not the same
|
|||
}
|
||||
else /* not in list, write the list to the file */
|
||||
{
|
||||
settings_fd = rb->creat(BOOKMARKS_FILE, O_WRONLY);
|
||||
settings_fd = rb->creat(BOOKMARKS_FILE);
|
||||
if (settings_fd >=0 )
|
||||
{
|
||||
if (++(data->bookmarked_files_count) > MAX_BOOKMARKED_FILES)
|
||||
|
|
@ -1120,7 +1120,7 @@ static void viewer_load_settings(void) /* same name as global, but not the same
|
|||
static void viewer_save_settings(void)/* same name as global, but not the same file.. */
|
||||
{
|
||||
int settings_fd;
|
||||
settings_fd = rb->creat(SETTINGS_FILE, O_WRONLY); /* create the settings file */
|
||||
settings_fd = rb->creat(SETTINGS_FILE); /* create the settings file */
|
||||
|
||||
rb->write (settings_fd, &prefs, sizeof(struct preferences));
|
||||
rb->close(settings_fd);
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ void load_settings(void) {
|
|||
}
|
||||
|
||||
void save_settings(void) {
|
||||
int fp = rb->creat("/.rockbox/rocks/.vu_meter", O_WRONLY);
|
||||
int fp = rb->creat("/.rockbox/rocks/.vu_meter");
|
||||
if(fp >= 0) {
|
||||
rb->write (fp, &settings, sizeof(struct saved_settings));
|
||||
rb->close(fp);
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ static int wav2wv (char *filename)
|
|||
extension [1] = extension [2];
|
||||
extension [2] = 0;
|
||||
|
||||
out_fd = rb->creat (filename, O_WRONLY);
|
||||
out_fd = rb->creat (filename);
|
||||
|
||||
extension [2] = extension [1];
|
||||
extension [1] = save_a;
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ static void save_snapshot_file_type(char *name, int type)
|
|||
int snsh;
|
||||
snsh = rb->open(name, O_WRONLY);
|
||||
if(snsh < 0) {
|
||||
snsh = rb->creat(name, O_WRONLY);
|
||||
snsh = rb->creat(name);
|
||||
if(snsh < 0) {
|
||||
put_msg("Could not create snapshot file");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue