F_SETPIPE_SZ ... The actual capacity (in bytes) that is set is
returned as the function result.
But the current fcntl_setpipe_size function assumes that the return value is 0 (success) or negative (failure). This makes the function panic due to debug_assert! in debug mode, and it returns Err on success in release mode.
This commit fixes the return value type and its checking, and adds a test for it.
fcntl
man page says that:But the current
fcntl_setpipe_size
function assumes that the return value is 0 (success) or negative (failure). This makes the function panic due todebug_assert!
in debug mode, and it returnsErr
on success in release mode.This commit fixes the return value type and its checking, and adds a test for it.
Closes #1163