projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
logging: add a LogHandler::getConfig() method
[folly.git]
/
folly
/
test
/
SubprocessTestParentDeathHelper.cpp
diff --git
a/folly/test/SubprocessTestParentDeathHelper.cpp
b/folly/test/SubprocessTestParentDeathHelper.cpp
index d752b84ca07f86da85ac6216eae605dda3411436..6c9a17eeb6d776269331f145ab4b2192d7ee627e 100644
(file)
--- a/
folly/test/SubprocessTestParentDeathHelper.cpp
+++ b/
folly/test/SubprocessTestParentDeathHelper.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 201
4
Facebook, Inc.
+ * Copyright 201
7
Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-22,17
+22,16
@@
// will verify that the file actually gets created, which means that everything
// worked as intended.
// will verify that the file actually gets created, which means that everything
// worked as intended.
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
#include <fcntl.h>
#include <signal.h>
-#include <
unistd
.h>
+#include <
sys/types
.h>
-#include <gflags/gflags.h>
#include <glog/logging.h>
#include <glog/logging.h>
-#include "folly/Conv.h"
-#include "folly/Subprocess.h"
+#include <folly/Conv.h>
+#include <folly/Subprocess.h>
+#include <folly/portability/GFlags.h>
+#include <folly/portability/Unistd.h>
using folly::Subprocess;
using folly::Subprocess;
@@
-40,7
+39,7
@@
DEFINE_bool(child, false, "");
namespace {
constexpr int kSignal = SIGUSR1;
namespace {
constexpr int kSignal = SIGUSR1;
-}
// namespace
+} // namespace
void runChild(const char* file) {
// Block SIGUSR1 so it's queued
void runChild(const char* file) {
// Block SIGUSR1 so it's queued
@@
-60,7
+59,7
@@
void runChild(const char* file) {
CHECK_ERR(creat(file, 0600));
}
CHECK_ERR(creat(file, 0600));
}
-void runParent(const char* file) {
+
[[noreturn]]
void runParent(const char* file) {
std::vector<std::string> args {"/proc/self/exe", "--child", file};
Subprocess proc(
args,
std::vector<std::string> args {"/proc/self/exe", "--child", file};
Subprocess proc(
args,
@@
-74,7
+73,7
@@
void runParent(const char* file) {
}
int main(int argc, char *argv[]) {
}
int main(int argc, char *argv[]) {
- g
oogle
::ParseCommandLineFlags(&argc, &argv, true);
+ g
flags
::ParseCommandLineFlags(&argc, &argv, true);
CHECK_EQ(argc, 2);
if (FLAGS_child) {
runChild(argv[1]);
CHECK_EQ(argc, 2);
if (FLAGS_child) {
runChild(argv[1]);
@@
-83,4
+82,3
@@
int main(int argc, char *argv[]) {
}
return 0;
}
}
return 0;
}
-