So says the compiler:
../../platforms/unix/plugins/FileCopyPlugin/sqUnixFileCopyPlugin.c:94:61: warning: result of comparison of constant 0 with boolean expression is always true [-Wtautological-constant-compare] if (( (read(in, mem, stat.st_size) != stat.st_size) >= 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ ../../platforms/unix/plugins/FileCopyPlugin/sqUnixFileCopyPlugin.c:95:56: warning: result of comparison of constant 0 with boolean expression is always true [-Wtautological-constant-compare] && (write(out, mem, stat.st_size) != stat.st_size) >= 0)
The compiler is right, this makes not much sense:
if (( (read(in, mem, stat.st_size) != stat.st_size) >= 0) && (write(out, mem, stat.st_size) != stat.st_size) >= 0)
Also, the `copy` function may leave open file descriptors in case of failure, so it badly need some attention.
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/pl...
Given the introductory comment, shouldn't we just nuke the whole thing?
On 2019-11-01, at 2:23 PM, Nicolas Cellier notifications@github.com wrote:
Given the introductory comment, shouldn't we just nuke the whole thing?
Almost certainly yes. It was a deliberately tacky quick hack done nearly 20 years ago as a way to copy a file with assorted metadata intact, mostly necessitated by Andreas' barking mad determination to have the VMMaker related file tree in a totally nuts layout. As best I recall it isn't used anymore but - warning - I haven't checked in a good while.
What we *should* have is a way to do it cleanly from the image, by using a well designed file handling regime. I know, I know, I'll stop there so you can cease laughing hysterically and catch your breath.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: JTC: Jump To Conclusions
vm-dev@lists.squeakfoundation.org