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/plugins/FileCopyPlugin/sqUnixFileCopyPlugin.c


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.