assign return code to errno