* open-output-file now uses a bytevector instead of a string to
represent the filename during ffi.
This commit is contained in:
parent
1586986dbe
commit
179063c117
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -842,8 +842,14 @@ ikrt_open_output_file(ikp fname, ikp flagptr, ikpcb* pcb){
|
|||
(int)flagptr);
|
||||
exit(-10);
|
||||
}
|
||||
int fd = open(string_data(fname), flags,
|
||||
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
char* name;
|
||||
if(tagof(fname) == bytevector_tag){
|
||||
name = (char*) fname + off_bytevector_data;
|
||||
} else {
|
||||
fprintf(stderr, "bug in ikrt_open_output_file\n");
|
||||
exit(-1);
|
||||
}
|
||||
int fd = open(name, flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||
if(fd == -1){
|
||||
fprintf(stderr, "openfile failed: %s\n", strerror(errno));
|
||||
return false_object;
|
||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -132,7 +132,7 @@
|
|||
(close-ports)
|
||||
(let ([fd/error
|
||||
(foreign-call "ikrt_open_output_file"
|
||||
filename
|
||||
(string->utf8-bytevector filename)
|
||||
(option-id options))])
|
||||
(if (fixnum? fd/error)
|
||||
(let ([port
|
||||
|
|
Loading…
Reference in New Issue