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

Side by Side Diff: content/plugin/plugin_main_linux.cc

Issue 9006028: Coverity fixes for uninitialized vars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing braces Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/public/common/show_desktop_notification_params.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <signal.h> 5 #include <signal.h>
6 #include <string.h> 6 #include <string.h>
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <syscall.h> 8 #include <syscall.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 11 matching lines...) Expand all
22 greg_t* regs = context->uc_mcontext.gregs; 22 greg_t* regs = context->uc_mcontext.gregs;
23 char instruction = *reinterpret_cast<char*>(regs[REG_RIP]); 23 char instruction = *reinterpret_cast<char*>(regs[REG_RIP]);
24 24
25 // Check whether this is the kind of SIGILL we care about. 25 // Check whether this is the kind of SIGILL we care about.
26 // (info->si_addr can be NULL when we get a SIGILL via other means, 26 // (info->si_addr can be NULL when we get a SIGILL via other means,
27 // like with kill.) 27 // like with kill.)
28 if (signum != SIGILL || instruction != kLAHFInstruction) { 28 if (signum != SIGILL || instruction != kLAHFInstruction) {
29 // Not the problem we're interested in. Reraise the signal. We 29 // Not the problem we're interested in. Reraise the signal. We
30 // need to be careful to handle threads etc. properly. 30 // need to be careful to handle threads etc. properly.
31 31
32 struct sigaction sa; 32 struct sigaction sa = { { NULL } };
33 sa.sa_flags = 0;
34 sigemptyset(&sa.sa_mask); 33 sigemptyset(&sa.sa_mask);
35 sa.sa_handler = SIG_DFL; 34 sa.sa_handler = SIG_DFL;
36 sigaction(signum, &sa, NULL); 35 sigaction(signum, &sa, NULL);
37 36
38 // block the current signal 37 // block the current signal
39 sigset_t block_set; 38 sigset_t block_set;
40 sigemptyset(&block_set); 39 sigemptyset(&block_set);
41 sigaddset(&block_set, signum); 40 sigaddset(&block_set, signum);
42 sigprocmask(SIG_BLOCK, &block_set, NULL); 41 sigprocmask(SIG_BLOCK, &block_set, NULL);
43 42
(...skipping 10 matching lines...) Expand all
54 } 53 }
55 54
56 } // namespace 55 } // namespace
57 56
58 // 64-bit Flash sometimes uses the LAHF instruction which isn't 57 // 64-bit Flash sometimes uses the LAHF instruction which isn't
59 // available on some CPUs. We can work around it by catching SIGILL 58 // available on some CPUs. We can work around it by catching SIGILL
60 // (illegal instruction), checking if the signal was caused by this 59 // (illegal instruction), checking if the signal was caused by this
61 // particular circumstance, emulating the instruction, and resuming. 60 // particular circumstance, emulating the instruction, and resuming.
62 // This function registers the signal handler. 61 // This function registers the signal handler.
63 void WorkaroundFlashLAHF() { 62 void WorkaroundFlashLAHF() {
64 struct sigaction action; 63 struct sigaction action = { { NULL } };
65 memset(&action, 0, sizeof(action));
66 action.sa_flags = SA_SIGINFO; 64 action.sa_flags = SA_SIGINFO;
67 action.sa_sigaction = &SignalHandler; 65 action.sa_sigaction = &SignalHandler;
68 66
69 sigaction(SIGILL, &action, NULL); 67 sigaction(SIGILL, &action, NULL);
70 } 68 }
71 69
72 #endif // defined(ARCH_CPU_64_BITS) 70 #endif // defined(ARCH_CPU_64_BITS)
OLDNEW
« no previous file with comments | « no previous file | content/public/common/show_desktop_notification_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698