A patch adding verbose errors



    Guys:

    I don't subscribe to the list, so please Cc me on the emails. Basically, a lot of people experience Gtk-warnings on shared memory problems, and the patch expands the errors to be more verbose and give people clues as to why shared memory calls are failing (usually maxing out SHMALL pages in 2.2.x kernels).

    Thank you!

    Roman
*** gdk/gdkimage.c.orig	Thu Sep 23 15:43:39 1999
--- gdk/gdkimage.c	Tue Oct 17 13:29:47 2000
***************
*** 44,49 ****
--- 44,51 ----
  #ifdef USE_SHM
  #include <sys/ipc.h>
  #include <sys/shm.h>
+ #include <errno.h>		
+ #include <string.h>		/* For strerror() */
  #endif /* USE_SHM */
  
  #include <X11/Xlib.h>
***************
*** 224,230 ****
  
  	      if (x_shm_info->shmid == -1)
  		{
! 		  g_warning ("shmget failed!");
  
  		  XDestroyImage (private->ximage);
  		  g_free (private->x_shm_info);
--- 226,232 ----
  
  	      if (x_shm_info->shmid == -1)
  		{
! 		  g_warning ("shmget failed: %s!", strerror(errno));
  
  		  XDestroyImage (private->ximage);
  		  g_free (private->x_shm_info);
***************
*** 240,246 ****
  
  	      if (x_shm_info->shmaddr == (char*) -1)
  		{
! 		  g_warning ("shmat failed!");
  
  		  XDestroyImage (private->ximage);
  		  shmctl (x_shm_info->shmid, IPC_RMID, 0);
--- 242,248 ----
  
  	      if (x_shm_info->shmaddr == (char*) -1)
  		{
! 		  g_warning ("shmat failed: %s!", strerror(errno));
  
  		  XDestroyImage (private->ximage);
  		  shmctl (x_shm_info->shmid, IPC_RMID, 0);
begin:vcard 
n:Sulzhyk;Roman
x-mozilla-html:TRUE
org:Starmedia;Engineering
adr:;;;;;;
version:2.1
email;internet:roman starmedia net
x-mozilla-cpt:;24384
fn:Roman Sulzhyk
end:vcard


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]