remove failed proper-save from vm
parent
1dc7ecfdc5
commit
09b82321b5
13
vm/image.c
13
vm/image.c
|
@ -112,10 +112,7 @@ bool save_image(const F_CHAR *filename)
|
||||||
FILE* file;
|
FILE* file;
|
||||||
F_HEADER h;
|
F_HEADER h;
|
||||||
|
|
||||||
F_CHAR temporary_filename[] = STRING_LITERAL("##saving-factor-image##");
|
|
||||||
|
|
||||||
file = OPEN_WRITE(filename);
|
file = OPEN_WRITE(filename);
|
||||||
//file = OPEN_WRITE(temporary_filename);
|
|
||||||
if(file == NULL)
|
if(file == NULL)
|
||||||
{
|
{
|
||||||
print_string("Cannot open image file: "); print_native_string(filename); nl();
|
print_string("Cannot open image file: "); print_native_string(filename); nl();
|
||||||
|
@ -167,16 +164,6 @@ bool save_image(const F_CHAR *filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(MOVE_FILE_FAILS(temporary_filename, filename))
|
|
||||||
{
|
|
||||||
print_string("Failed to rename tempoarary image file: "); print_string(strerror(errno)); nl();
|
|
||||||
//if(DELETE_FILE_FAILS(temporary_filename))
|
|
||||||
//print_string("Failed to clean up temporary image file: "); print_string(strerror(errno)); nl();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void primitive_save_image(void)
|
void primitive_save_image(void)
|
||||||
|
|
|
@ -22,8 +22,6 @@ typedef char F_SYMBOL;
|
||||||
#define STRCMP strcmp
|
#define STRCMP strcmp
|
||||||
#define STRNCMP strncmp
|
#define STRNCMP strncmp
|
||||||
#define STRDUP strdup
|
#define STRDUP strdup
|
||||||
#define MOVE_FILE_FAILS(old,new) (rename((old),(new)) < 0)
|
|
||||||
#define DELETE_FILE_FAILS(old) (unlink((old)) < 0)
|
|
||||||
|
|
||||||
#define FIXNUM_FORMAT "%ld"
|
#define FIXNUM_FORMAT "%ld"
|
||||||
#define CELL_FORMAT "%lu"
|
#define CELL_FORMAT "%lu"
|
||||||
|
|
|
@ -19,8 +19,6 @@ typedef wchar_t F_CHAR;
|
||||||
#define STRCMP wcscmp
|
#define STRCMP wcscmp
|
||||||
#define STRNCMP wcsncmp
|
#define STRNCMP wcsncmp
|
||||||
#define STRDUP _wcsdup
|
#define STRDUP _wcsdup
|
||||||
#define MOVE_FILE_FAILS(old,new) (MoveFile((old),(new)) == 0)
|
|
||||||
#define DELETE_FILE_FAILS(old) (DeleteFile((old)) == 0)
|
|
||||||
|
|
||||||
#ifdef WIN64
|
#ifdef WIN64
|
||||||
#define CELL_FORMAT "%Iu"
|
#define CELL_FORMAT "%Iu"
|
||||||
|
|
Loading…
Reference in New Issue