joyent/node — Issue #2051: Assertion error when fs.futimes() is called and futime() is not supported.
Author: shigeki
Created: 2011-11-08 16:29:40+00:00
State: open

As described the same case of the pull request of https://github.com/joyent/node/pull/2050, test/simple/test-fs-utimes.js was failed with assertion error at assert(r == 0); of src/node_file.cc:279 when futime(3) is not supported on the platform because uv_fs_futime() returns -1.

There seems to have several options to fix.

option #0: Let this as is, fs.futimesSync() throw ENOSYS error and fs.futimes() get an assertion error.
option #1: Both throws ENOSYS error
option #2: fs.futimes() have a callback with ENOSYS error.

I made a patch of option #2 as below but I'm not sure that this also works fine at ENOMEM error cases

https://github.com/shigeki/node/commit/8663b64ef364963873abad57ac3560fcf3067378

I would like to know if there has another alternatives to fix this issue.