1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

give parent a sec to terminate

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@559 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Philip Kovacs 2006-03-07 20:35:11 +00:00
parent d7b85bbf02
commit 12c36bd8d9
2 changed files with 9 additions and 8 deletions

View File

@ -5640,21 +5640,22 @@ int main(int argc, char **argv)
text = NULL; text = NULL;
/* fork */ /* fork */
if (fork_to_background) { if (fork_to_background) {
int ret = fork(); int pid = fork();
switch (ret) { switch (pid) {
case -1: case -1:
ERR("can't fork() to background: %s", ERR("can't fork() to background: %s",
strerror(errno)); strerror(errno));
break; break;
case 0: case 0:
/* child process */
sleep(1);
fprintf(stderr,"\n");fflush(stderr);
break; break;
default: default:
fprintf /* parent process */
(stderr, fprintf(stderr,"Conky: forked to background, pid is %d\n",pid);
"Conky: forked to background, pid is %d\n",
ret);
fflush(stderr); fflush(stderr);
return 0; return 0;
} }

View File

@ -151,9 +151,9 @@ static Window find_desktop_window(Window *p_root, Window *p_desktop)
if (win != root) if (win != root)
fprintf(stderr, fprintf(stderr,
"\nConky: desktop window (%lx) is subwindow of root window (%lx)\n",win,root); "Conky: desktop window (%lx) is subwindow of root window (%lx)\n",win,root);
else else
fprintf(stderr, "\nConky: desktop window (%lx) is root window\n",win); fprintf(stderr, "Conky: desktop window (%lx) is root window\n",win);
fflush(stderr); fflush(stderr);