]> Dogcows Code - chaz/openbox/blobdiff - otk/display.cc
add \n's to errors
[chaz/openbox] / otk / display.cc
index c1d6c61e0dfeb242a909eb98ac09063695d45414..98288bd02dcdf54990437673a55fb1e9d14264f4 100644 (file)
@@ -7,6 +7,7 @@
 #include "display.hh"
 #include "screeninfo.hh"
 #include "gccache.hh"
+#include "util.hh"
 
 extern "C" {
 #include <X11/keysym.h>
@@ -27,10 +28,6 @@ extern "C" {
 #  include <stdio.h>
 #endif // HAVE_STDIO_H
 
-#ifdef    HAVE_STDLIB_H
-#  include <stdlib.h>
-#endif // HAVE_STDLIB_H
-
 #ifdef    HAVE_SIGNAL_H
 #  include <signal.h>
 #endif // HAVE_SIGNAL_H
@@ -93,7 +90,6 @@ void OBDisplay::initialize(char *name)
   (void)junk;
 
   // Open the X display
-  printf("getenv(DISPLAY)=%s\n", getenv("DISPLAY"));
   if (!(display = XOpenDisplay(name))) {
     printf(_("Unable to open connection to the X server. Please set the \n\
 DISPLAY environment variable approriately, or use the '-display' command \n\
@@ -111,11 +107,7 @@ line argument.\n\n"));
   // set the DISPLAY environment variable for any lauched children, to the
   // display we're using, so they open in the right place.
   // XXX rm -> std::string dtmp = "DISPLAY=" + DisplayString(display);
-  if (putenv(const_cast<char*>((std::string("DISPLAY=") +
-                                DisplayString(display)).c_str()))) {
-    printf(_("warning: couldn't set environment variable 'DISPLAY'\n"));
-    perror("putenv()");
-  }
+  putenv(std::string("DISPLAY=") + DisplayString(display));
   
   // find the availability of X extensions we like to use
 #ifdef XKB
This page took 0.021574 seconds and 4 git commands to generate.