give parent a sec to terminate
authorPhilip Kovacs <pkovacs@users.sourceforge.net>
Tue, 7 Mar 2006 20:35:11 +0000 (20:35 +0000)
committerPhilip Kovacs <pkovacs@users.sourceforge.net>
Tue, 7 Mar 2006 20:35:11 +0000 (20:35 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@559 7f574dfc-610e-0410-a909-a81674777703

src/conky.c
src/x11.c

index bbaae22..a670344 100644 (file)
@@ -5640,21 +5640,22 @@ int main(int argc, char **argv)
        text = NULL;
        /* fork */
        if (fork_to_background) {
-               int ret = fork();
-               switch (ret) {
+               int pid = fork();
+               switch (pid) {
                case -1:
                        ERR("can't fork() to background: %s",
                            strerror(errno));
                        break;
 
                case 0:
+                       /* child process */
+                       sleep(1);
+                       fprintf(stderr,"\n");fflush(stderr);
                        break;
 
                default:
-                       fprintf
-                           (stderr,
-                            "Conky: forked to background, pid is %d\n",
-                            ret);
+                       /* parent process */
+                       fprintf(stderr,"Conky: forked to background, pid is %d\n",pid);
                        fflush(stderr);
                        return 0;
                }
index aae5035..090ccb1 100644 (file)
--- a/src/x11.c
+++ b/src/x11.c
@@ -151,9 +151,9 @@ static Window find_desktop_window(Window *p_root, Window *p_desktop)
 
        if (win != root)
                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
-               fprintf(stderr, "\nConky: desktop window (%lx) is root window\n",win);
+               fprintf(stderr, "Conky: desktop window (%lx) is root window\n",win);
 
        fflush(stderr);