Update serv.c

Removed the error of abrupt termination of server.