}
/* If we are the parent, terminate */
- if(pid)
+ if(pid) {
exit(0);
+ }
/* Detach by becoming the new process group leader */
if(setsid() < 0) {
status = vsnprintf(*buf, len, fmt, aq);
va_end(aq);
- if(status >= 0)
+ if(status >= 0) {
*buf = xrealloc(*buf, status + 1);
+ }
if(status > len - 1) {
len = status + 1;