os: fix compilation with -cc gcc -prod of programs using os.cp
parent
e534f8507b
commit
16bf300934
|
@ -171,7 +171,7 @@ pub fn cp(old, new string) ?bool {
|
||||||
if fp_from < 0 { // Check if file opened
|
if fp_from < 0 { // Check if file opened
|
||||||
return error_with_code('cp: failed to open $old', int(fp_from))
|
return error_with_code('cp: failed to open $old', int(fp_from))
|
||||||
}
|
}
|
||||||
fp_to := C.open(new.str, C.O_WRONLY | C.O_CREAT | C.O_TRUNC)
|
fp_to := C.open(new.str, C.O_WRONLY | C.O_CREAT | C.O_TRUNC, C.S_IWUSR | C.S_IRUSR)
|
||||||
if fp_to < 0 { // Check if file opened (permissions problems ...)
|
if fp_to < 0 { // Check if file opened (permissions problems ...)
|
||||||
C.close(fp_from)
|
C.close(fp_from)
|
||||||
return error_with_code('cp: failed to write to $new', int(fp_to))
|
return error_with_code('cp: failed to write to $new', int(fp_to))
|
||||||
|
|
Loading…
Reference in New Issue