Unless the signing function terminates abnormally (which would cause the program to crash) it always returns zero.  This might be a significant problem.