Add some check of return value

signal()
recv()