Update daemon.c

add another way to realize daemon