fix shmat() return value check bug