summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-05-06 17:35:04 +0000
committerThomas Martitz <kugel@rockbox.org>2010-05-06 17:35:04 +0000
commitc61e89c0eda126c2c1a4a3983520c35fe30db156 (patch)
tree1285f8cbde5485f93f8653f31ea0454587dd741e /apps/plugins
parent684c70bac5f27e8dec49e113563cf6e496da854d (diff)
downloadrockbox-c61e89c0eda126c2c1a4a3983520c35fe30db156.zip
rockbox-c61e89c0eda126c2c1a4a3983520c35fe30db156.tar.gz
rockbox-c61e89c0eda126c2c1a4a3983520c35fe30db156.tar.bz2
rockbox-c61e89c0eda126c2c1a4a3983520c35fe30db156.tar.xz
Make creat() posix compliant API-wise. Shouldn't affect the core as it's wrapped via a static inline.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/calendar.c2
-rw-r--r--apps/plugins/clock/clock_settings.c2
-rw-r--r--apps/plugins/disktidy.c2
-rw-r--r--apps/plugins/goban/util.c2
-rw-r--r--apps/plugins/iriverify.c2
-rw-r--r--apps/plugins/lib/configfile.c2
-rw-r--r--apps/plugins/lib/pluginlib_bmp.c2
-rw-r--r--apps/plugins/pictureflow/pictureflow.c2
-rw-r--r--apps/plugins/pitch_detector.c2
-rw-r--r--apps/plugins/random_folder_advance_config.c4
-rw-r--r--apps/plugins/shortcuts/shortcuts_common.c2
-rw-r--r--apps/plugins/test_codec.c2
-rw-r--r--apps/plugins/test_disk.c6
-rw-r--r--apps/plugins/vbrfix.c2
-rw-r--r--apps/plugins/vu_meter.c2
-rw-r--r--apps/plugins/wav2wv.c2
-rw-r--r--apps/plugins/zxbox/snapshot.c2
17 files changed, 20 insertions, 20 deletions
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index d6a1a9a..3589998 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -612,7 +612,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);
- fq = rb->creat(TEMP_FILE);
+ fq = rb->creat(TEMP_FILE, 0666);
if ( (fq > -1) && (fp > -1) )
{
int i;
diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c
index 8464ab0..a407ebe 100644
--- a/apps/plugins/clock/clock_settings.c
+++ b/apps/plugins/clock/clock_settings.c
@@ -119,7 +119,7 @@ enum settings_file_status clock_settings_load(struct clock_settings* settings,
enum settings_file_status clock_settings_save(struct clock_settings* settings,
char* filename){
- int fd = rb->creat(filename);
+ int fd = rb->creat(filename, 0666);
if(fd >= 0){ /* does file exist? */
rb->write (fd, settings, sizeof(*settings));
rb->close(fd);
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c
index 3d2685f..8d8515e 100644
--- a/apps/plugins/disktidy.c
+++ b/apps/plugins/disktidy.c
@@ -536,7 +536,7 @@ enum plugin_status plugin_start(const void* parameter)
status = tidy_lcd_menu();
if (tidy_loaded_and_changed)
{
- int fd = rb->creat(CUSTOM_FILES);
+ int fd = rb->creat(CUSTOM_FILES, 0666);
int i;
if (fd >= 0)
{
diff --git a/apps/plugins/goban/util.c b/apps/plugins/goban/util.c
index 0e83173..bb78316 100644
--- a/apps/plugins/goban/util.c
+++ b/apps/plugins/goban/util.c
@@ -221,7 +221,7 @@ create_or_open_file (const char *filename)
if (!rb->file_exists (filename))
{
- fd = rb->creat (filename);
+ fd = rb->creat(filename, 0666);
}
else
{
diff --git a/apps/plugins/iriverify.c b/apps/plugins/iriverify.c
index 546601b..4e8ca5b 100644
--- a/apps/plugins/iriverify.c
+++ b/apps/plugins/iriverify.c
@@ -67,7 +67,7 @@ static int write_file(void)
rb->snprintf(tmpfilename, MAX_PATH+1, "%s.tmp", filename);
- fd = rb->creat(tmpfilename);
+ fd = rb->creat(tmpfilename, 0666);
if(fd < 0)
return 10 * fd - 1;
diff --git a/apps/plugins/lib/configfile.c b/apps/plugins/lib/configfile.c
index 21b66a3..0fb01c6 100644
--- a/apps/plugins/lib/configfile.c
+++ b/apps/plugins/lib/configfile.c
@@ -46,7 +46,7 @@ int configfile_save(const char *filename, struct configdata *cfg,
char buf[MAX_PATH];
get_cfg_filename(buf, MAX_PATH, filename);
- fd = rb->creat(buf);
+ fd = rb->creat(buf, 0666);
if(fd < 0)
return fd*10 - 1;
diff --git a/apps/plugins/lib/pluginlib_bmp.c b/apps/plugins/lib/pluginlib_bmp.c
index 8520a8b..148aa8e 100644
--- a/apps/plugins/lib/pluginlib_bmp.c
+++ b/apps/plugins/lib/pluginlib_bmp.c
@@ -60,7 +60,7 @@ int save_bmp_file( char* filename, struct bitmap *bm )
int fh;
int x,y;
if( bm->format != FORMAT_NATIVE ) return -1;
- fh = rb->creat( filename );
+ fh = rb->creat( filename , 0666);
if( fh < 0 ) return -1;
rb->write( fh, header, sizeof( header ) );
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index b12c8e8..463f86c 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -1161,7 +1161,7 @@ bool save_pfraw(char* filename, struct bitmap *bm)
struct pfraw_header bmph;
bmph.width = bm->width;
bmph.height = bm->height;
- int fh = rb->creat( filename );
+ int fh = rb->creat( filename , 0666);
if( fh < 0 ) return false;
rb->write( fh, &bmph, sizeof( struct pfraw_header ) );
int y;
diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c
index 10125c1..de0aff9 100644
--- a/apps/plugins/pitch_detector.c
+++ b/apps/plugins/pitch_detector.c
@@ -381,7 +381,7 @@ enum settings_file_status tuner_settings_load(struct tuner_settings* settings,
enum settings_file_status tuner_settings_save(struct tuner_settings* settings,
char* filename)
{
- int fd = rb->creat(filename);
+ int fd = rb->creat(filename, 0666);
if(fd >= 0){ /* does file exist? */
rb->write (fd, settings, sizeof(*settings));
rb->close(fd);
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c
index 5f83798..6a62fee 100644
--- a/apps/plugins/random_folder_advance_config.c
+++ b/apps/plugins/random_folder_advance_config.c
@@ -263,7 +263,7 @@ int load_list(void)
int save_list(void)
{
- int myfd = rb->creat(RFA_FILE);
+ int myfd = rb->creat(RFA_FILE, 0666);
if (myfd < 0)
{
rb->splash(HZ, "Could Not Open " RFA_FILE);
@@ -388,7 +388,7 @@ int export_list_to_file_text(void)
}
/* create and open the file */
- int myfd = rb->creat(RFA_FILE_TEXT);
+ int myfd = rb->creat(RFA_FILE_TEXT, 0666);
if (myfd < 0)
{
rb->splashf(HZ*4, "failed to open: fd = %d, file = %s",
diff --git a/apps/plugins/shortcuts/shortcuts_common.c b/apps/plugins/shortcuts/shortcuts_common.c
index 68817d3..dee1657 100644
--- a/apps/plugins/shortcuts/shortcuts_common.c
+++ b/apps/plugins/shortcuts/shortcuts_common.c
@@ -85,7 +85,7 @@ bool load_sc_file(sc_file_t *file, char *filename, bool must_exist,
/* The file didn't exist on disk */
if (!must_exist) {
DEBUGF("Trying to create link file '%s'...\n", filename);
- fd = rb->creat(filename);
+ fd = rb->creat(filename, 0666);
if (fd < 0){
/* For some reason we couldn't create the file,
* so return an error message and exit */
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c
index 03c2daa..f3b826e 100644
--- a/apps/plugins/test_codec.c
+++ b/apps/plugins/test_codec.c
@@ -167,7 +167,7 @@ void init_wav(char* filename)
{
wavinfo.totalsamples = 0;
- wavinfo.fd = rb->creat(filename);
+ wavinfo.fd = rb->creat(filename, 0666);
if (wavinfo.fd >= 0)
{
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c
index 9d186e0..396e03c 100644
--- a/apps/plugins/test_disk.c
+++ b/apps/plugins/test_disk.c
@@ -123,7 +123,7 @@ static bool test_fs(void)
rb->snprintf(text_buf, sizeof text_buf, "Data size: %dKB", (TEST_SIZE>>10));
log_text(text_buf, true);
- fd = rb->creat(TEST_FILE);
+ fd = rb->creat(TEST_FILE, 0666);
if (fd < 0)
{
rb->splash(HZ, "creat() failed.");
@@ -211,7 +211,7 @@ static bool file_speed(int chunksize, bool align)
log_text("--------------------", true);
/* File creation write speed */
- fd = rb->creat(TEST_FILE);
+ fd = rb->creat(TEST_FILE, 0666);
if (fd < 0)
{
rb->splash(HZ, "creat() failed.");
@@ -311,7 +311,7 @@ static bool test_speed(void)
for (i = 0; TIME_BEFORE(*rb->current_tick, time); i++)
{
rb->snprintf(text_buf, sizeof(text_buf), TESTBASEDIR "/%08x.tmp", i);
- fd = rb->creat(text_buf);
+ fd = rb->creat(text_buf, 0666);
if (fd < 0)
{
last_file = i;
diff --git a/apps/plugins/vbrfix.c b/apps/plugins/vbrfix.c
index 3e152be..2ca0176 100644
--- a/apps/plugins/vbrfix.c
+++ b/apps/plugins/vbrfix.c
@@ -49,7 +49,7 @@ static int insert_data_in_file(const char *fname, int fpos, char *buf, int num_b
return 10*orig_fd - 1;
}
- fd = rb->creat(tmpname);
+ fd = rb->creat(tmpname, 0666);
if(fd < 0) {
rb->close(orig_fd);
return 10*fd - 2;
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index 7cf5a5f..fc04bc7 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -457,7 +457,7 @@ void load_settings(void) {
}
void save_settings(void) {
- int fp = rb->creat(PLUGIN_DEMOS_DIR "/.vu_meter");
+ int fp = rb->creat(PLUGIN_DEMOS_DIR "/.vu_meter", 0666);
if(fp >= 0) {
rb->write (fp, &vumeter_settings, sizeof(struct saved_settings));
rb->close(fp);
diff --git a/apps/plugins/wav2wv.c b/apps/plugins/wav2wv.c
index 1102d13..0390088 100644
--- a/apps/plugins/wav2wv.c
+++ b/apps/plugins/wav2wv.c
@@ -169,7 +169,7 @@ static int wav2wv(const char *infile)
outextension = outfile + rb->strlen(outfile) - 3;
outextension[1] = outextension[2];
outextension[2] = 0;
- out_fd = rb->creat(outfile);
+ out_fd = rb->creat(outfile, 0666);
if (out_fd < 0) {
rb->splash(HZ*2, "could not create file!");
diff --git a/apps/plugins/zxbox/snapshot.c b/apps/plugins/zxbox/snapshot.c
index 6efb29f..0b80b64 100644
--- a/apps/plugins/zxbox/snapshot.c
+++ b/apps/plugins/zxbox/snapshot.c
@@ -584,7 +584,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);
+ snsh = rb->creat(name, 0666);
if(snsh < 0) {
put_msg("Could not create snapshot file");
return;