mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2025-12-28 10:15:10 +01:00
Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close.
It is incorrect to wrap close in HANDLE_EINTR on Linux.
Unnecessary #includes of eintr_wrapper.h are also removed. The variable naming
within the macro is also updated per Chromium r178174.
einter_wrapper.h contains a non-mechanical change. Mechanical changes were
generated by running:
sed -E -i '' \
-e 's/((=|if|return|CHECK|EXPECT|ASSERT).*)HANDLE(_EINTR\(.*close)/\1IGNORE\3/' \
-e 's/(ignore_result|void ?)\(HANDLE_EINTR\((.*close\(.*)\)\)/\2/' \
-e 's/(\(void\) ?)?HANDLE_EINTR\((.*close\(.*)\)/\2/' \
$(grep -rl HANDLE_EINTR.*close . --exclude-dir=.svn)
sed -E -i '' -e '/#include.*eintr_wrapper\.h"/d' \
$(grep -EL '(HANDLE|IGNORE)_EINTR' \
$(grep -Elr '#include.*eintr_wrapper\.h"' . --exclude-dir=.svn))
BUG=chromium:269623
R=ted.mielczarek@gmail.com
Review URL: https://breakpad.appspot.com/784002
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1239 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
b303174e32
commit
036dec3ecc
7 changed files with 26 additions and 19 deletions
|
|
@ -349,7 +349,7 @@ CrashGenerationServer::ClientEvent(short revents)
|
|||
// A nasty process could try and send us too many descriptors and
|
||||
// force a leak.
|
||||
for (unsigned i = 0; i < num_fds; ++i)
|
||||
HANDLE_EINTR(close(reinterpret_cast<int*>(CMSG_DATA(hdr))[i]));
|
||||
close(reinterpret_cast<int*>(CMSG_DATA(hdr))[i]);
|
||||
return true;
|
||||
} else {
|
||||
signal_fd = reinterpret_cast<int*>(CMSG_DATA(hdr))[0];
|
||||
|
|
@ -363,7 +363,7 @@ CrashGenerationServer::ClientEvent(short revents)
|
|||
|
||||
if (crashing_pid == -1 || signal_fd == -1) {
|
||||
if (signal_fd)
|
||||
HANDLE_EINTR(close(signal_fd));
|
||||
close(signal_fd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -375,12 +375,12 @@ CrashGenerationServer::ClientEvent(short revents)
|
|||
|
||||
ino_t inode_number;
|
||||
if (!GetInodeForFileDescriptor(&inode_number, signal_fd)) {
|
||||
HANDLE_EINTR(close(signal_fd));
|
||||
close(signal_fd);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!FindProcessHoldingSocket(&crashing_pid, inode_number - 1)) {
|
||||
HANDLE_EINTR(close(signal_fd));
|
||||
close(signal_fd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -391,7 +391,7 @@ CrashGenerationServer::ClientEvent(short revents)
|
|||
if (!google_breakpad::WriteMinidump(minidump_filename.c_str(),
|
||||
crashing_pid, crash_context,
|
||||
kCrashContextSize)) {
|
||||
HANDLE_EINTR(close(signal_fd));
|
||||
close(signal_fd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -410,7 +410,7 @@ CrashGenerationServer::ClientEvent(short revents)
|
|||
msg.msg_iovlen = 1;
|
||||
|
||||
HANDLE_EINTR(sendmsg(signal_fd, &msg, MSG_DONTWAIT | MSG_NOSIGNAL));
|
||||
HANDLE_EINTR(close(signal_fd));
|
||||
close(signal_fd);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
#include "breakpad_googletest_includes.h"
|
||||
#include "client/linux/minidump_writer/cpu_set.h"
|
||||
#include "common/linux/eintr_wrapper.h"
|
||||
#include "common/tests/auto_testfile.h"
|
||||
|
||||
using namespace google_breakpad;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include "client/linux/minidump_writer/line_reader.h"
|
||||
#include "breakpad_googletest_includes.h"
|
||||
#include "common/linux/eintr_wrapper.h"
|
||||
#include "common/tests/auto_testfile.h"
|
||||
|
||||
using namespace google_breakpad;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
|
||||
#include "client/linux/minidump_writer/proc_cpuinfo_reader.h"
|
||||
#include "breakpad_googletest_includes.h"
|
||||
#include "common/linux/eintr_wrapper.h"
|
||||
#include "common/tests/auto_testfile.h"
|
||||
|
||||
using namespace google_breakpad;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue