Fixed always returning -2 in process_req()

Add test of openfd()