It might be easier to just write a wrapper program:
if(WEXITSTATUS(system("command_to_start_server")) <= 0)
system() won't return until the server exits (or crashes) and if the server is sane it will return 0 on a successful exit. If it crashes the return value should be greater than 0.
Then you can just run this wrapper program to start the server and it should constantly restart it as long as it crashes and doesn't exit normally.