mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-29 13:03:36 +01:00
fs: use a static variable in calls to BFile_Create()
There is no evidence that BFile_Create() keeps the address and writes to it later on, but I'd rather be overly careful than have to debug a stack corruption problem in half a year :)
This commit is contained in:
parent
59a3b39fb4
commit
8aea762e7a
1 changed files with 3 additions and 3 deletions
|
@ -6,7 +6,7 @@
|
|||
#include "util.h"
|
||||
#include "fugue.h"
|
||||
|
||||
/* TODO: fugue_open(): Handle trailing '/' and filesystem root */
|
||||
static int new_file_size;
|
||||
|
||||
int fugue_open(char const *path, int flags, GUNUSED mode_t mode)
|
||||
{
|
||||
|
@ -91,8 +91,8 @@ int fugue_open(char const *path, int flags, GUNUSED mode_t mode)
|
|||
|
||||
/* If the file does not exist and O_CREAT is set, create it */
|
||||
if((flags & O_CREAT) && ((flags & O_TRUNC) || fugue_fd < 0)) {
|
||||
int size = 0;
|
||||
err = BFile_Create(fcpath, BFile_File, &size);
|
||||
new_file_size = 0;
|
||||
err = BFile_Create(fcpath, BFile_File, &new_file_size);
|
||||
if(err < 0) {
|
||||
errno = bfile_error_to_errno(err);
|
||||
rc = -1;
|
||||
|
|
Loading…
Reference in a new issue