Sorry, the sighandler is not supposed to return int is should be void. But still my problem remains unsolved.
I dont think switch case is any better here (I just dont like it thats all), and while(1) pause makes the process wait until it gets a signal from somewhere.