Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jan 2013 11:34:09 +0000 (UTC)
From:      Rene Ladan <rene@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r310861 - head/www/chromium/files
Message-ID:  <201301231134.r0NBY95x074907@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rene
Date: Wed Jan 23 11:34:09 2013
New Revision: 310861
URL: http://svnweb.freebsd.org/changeset/ports/310861

Log:
  Remove shared memory keys only if no segments are attached.
  
  This fixes a bug when kern.ipc.shm_allow_removed was set to 0.
  Submitted by:	George Liaskos

Modified:
  head/www/chromium/files/patch-ui__surface__transport_dib_linux.cc   (contents, props changed)

Modified: head/www/chromium/files/patch-ui__surface__transport_dib_linux.cc
==============================================================================
--- head/www/chromium/files/patch-ui__surface__transport_dib_linux.cc	Wed Jan 23 09:46:39 2013	(r310860)
+++ head/www/chromium/files/patch-ui__surface__transport_dib_linux.cc	Wed Jan 23 11:34:09 2013	(r310861)
@@ -1,18 +1,21 @@
---- ui/surface/transport_dib_linux.cc.orig	2011-09-14 11:02:00.000000000 +0300
-+++ ui/surface/transport_dib_linux.cc	2011-09-21 13:59:55.000000000 +0300
-@@ -31,6 +31,11 @@
-     address_ = kInvalidAddress;
+--- ui/surface/transport_dib_linux.cc.orig	2013-01-08 04:46:06.000000000 +0200
++++ ui/surface/transport_dib_linux.cc	2013-01-17 23:27:10.221168481 +0200
+@@ -37,6 +37,14 @@
+     DCHECK(display_);
+     ui::DetachSharedMemory(display_, x_shm_);
    }
- 
++
 +#if defined(OS_FREEBSD)
-+  if(is_valid_id(key_))
-+    shmctl(key_.shmkey, IPC_RMID, 0);
++  if (is_valid_id(key_)) {
++    struct shmid_ds shmst;
++    if (shmctl(key_.shmkey, IPC_STAT, &shmst) == 0 && shmst.shm_nattch == 0)
++      shmctl(key_.shmkey, IPC_RMID, 0);
++  }
 +#endif
-+
-   if (x_shm_) {
-     DCHECK(display_);
-     ui::DetachSharedMemory(display_, x_shm_);
-@@ -50,10 +55,13 @@
+ }
+ 
+ // static
+@@ -51,10 +59,13 @@
    }
  
    void* address = shmat(shmkey, NULL /* desired address */, 0 /* flags */);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301231134.r0NBY95x074907>