diff -Nru xloadimage.4.1.orig/xloadimage.c xloadimage.4.1/xloadimage.c --- xloadimage.4.1.orig/xloadimage.c 1993-11-05 15:11:46.000000000 +0100 +++ xloadimage.4.1/xloadimage.c 2005-10-30 18:17:03.000000000 +0100 @@ -236,18 +236,6 @@ exit(0); } - /* start talking to the display - */ - - opt= getOption(global_options, DISPLAY); - dname= (opt ? opt->info.display : NULL); - if (! (Disp= disp= XOpenDisplay(dname))) { - printf("%s: Cannot open display\n", XDisplayName(dname)); - exit(1); - } - Scrn= scrn= DefaultScreen(disp); - XSetErrorHandler(errorHandler); - /* background ourselves if the user asked us to */ @@ -264,6 +252,18 @@ } #endif /* !NO_FORK */ + /* start talking to the display + */ + + opt= getOption(global_options, DISPLAY); + dname= (opt ? opt->info.display : NULL); + if (! (Disp= disp= XOpenDisplay(dname))) { + printf("%s: Cannot open display\n", XDisplayName(dname)); + exit(1); + } + Scrn= scrn= DefaultScreen(disp); + XSetErrorHandler(errorHandler); + dispimage= NULL; onroot= (getOption(global_options, ONROOT) != NULL);