Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: dev-libs/opencryptoki/files/opencryptoki-2.2.8-steal_shmem.patch

Issue 2471003: Make pkcsslotd grab the shared memory it needs, even if it wasnt freed by a previous instance (Closed) Base URL: ssh://git@chromiumos-git//chromiumos-overlay.git
Patch Set: Move logging a bit Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | dev-libs/opencryptoki/opencryptoki-2.2.8.ebuild » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dev-libs/opencryptoki/files/opencryptoki-2.2.8-steal_shmem.patch
diff --git a/dev-libs/opencryptoki/files/opencryptoki-2.2.8-steal_shmem.patch b/dev-libs/opencryptoki/files/opencryptoki-2.2.8-steal_shmem.patch
new file mode 100644
index 0000000000000000000000000000000000000000..1b37a5ac21639a8fe1cd128a0a18fb90ddd384c6
--- /dev/null
+++ b/dev-libs/opencryptoki/files/opencryptoki-2.2.8-steal_shmem.patch
@@ -0,0 +1,33 @@
+diff -Naur opencryptoki-2.2.8.orig/usr/sbin/pkcsslotd/shmem.c opencryptoki-2.2.8/usr/sbin/pkcsslotd/shmem.c
+--- opencryptoki-2.2.8.orig/usr/sbin/pkcsslotd/shmem.c 2010-06-02 09:18:27.000000000 -0700
++++ opencryptoki-2.2.8/usr/sbin/pkcsslotd/shmem.c 2010-06-02 10:56:42.000000000 -0700
+@@ -374,10 +374,20 @@
+
+
+ if ( shmid < 0 ) {
+- ErrLog(SLOTD_MSG(SHMEMCR,
+- "Shared memory creation failed (0x%X)\n"), errno);
+- ErrLog(SLOTD_MSG(IPCRM, "perform ipcrm -M 0x%X\n"), tok);
+- return FALSE;
++ ErrLog(SLOTD_MSG(SHMEMCR,
++ "Shared memory creation failed (0x%X)\n"), errno);
++ ErrLog(SLOTD_MSG(SHMEMCR, "Reclaiming 0x%X\n"), tok);
++ shmid = shmget( tok, sizeof( Slot_Mgr_Shr_t ), 0 );
++ DestroySharedMemory();
++ shmid = shmget( tok, sizeof( Slot_Mgr_Shr_t ),
++ IPC_CREAT | IPC_EXCL | S_IRUSR |
++ S_IRGRP | S_IWUSR | S_IWGRP );
++ if ( shmid < 0 ) {
++ ErrLog(SLOTD_MSG(SHMEMCR,
++ "Shared memory reclamation failed (0x%X)\n"), errno);
++ ErrLog(SLOTD_MSG(IPCRM, "perform ipcrm -M 0x%X\n"), tok);
++ return FALSE;
++ }
+ }
+
+ // SAB Set the group ownership of the shared mem segment..
+@@ -704,4 +714,3 @@
+
+
+ }
+-
Will Drewry 2010/06/02 18:37:06 looks like you dropped an empty line down here.
« no previous file with comments | « no previous file | dev-libs/opencryptoki/opencryptoki-2.2.8.ebuild » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698