mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add missing newline
PiperOrigin-RevId: 304659346
This commit is contained in:
committed by
gVisor bot
parent
1921c246a9
commit
ea98693d91
@@ -812,26 +812,28 @@ void ExecFromThread() {
|
||||
bool ValidateProcCmdlineVsArgv(const int argc, const char* const* argv) {
|
||||
auto contents_or = GetContents("/proc/self/cmdline");
|
||||
if (!contents_or.ok()) {
|
||||
std::cerr << "Unable to get /proc/self/cmdline: " << contents_or.error();
|
||||
std::cerr << "Unable to get /proc/self/cmdline: " << contents_or.error()
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
auto contents = contents_or.ValueOrDie();
|
||||
if (contents.back() != '\0') {
|
||||
std::cerr << "Non-null terminated /proc/self/cmdline!";
|
||||
std::cerr << "Non-null terminated /proc/self/cmdline!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
contents.pop_back();
|
||||
std::vector<std::string> procfs_cmdline = absl::StrSplit(contents, '\0');
|
||||
|
||||
if (static_cast<int>(procfs_cmdline.size()) != argc) {
|
||||
std::cerr << "argc = " << argc << " != " << procfs_cmdline.size();
|
||||
std::cerr << "argc = " << argc << " != " << procfs_cmdline.size()
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
if (procfs_cmdline[i] != argv[i]) {
|
||||
std::cerr << "Procfs command line argument " << i << " mismatch "
|
||||
<< procfs_cmdline[i] << " != " << argv[i];
|
||||
<< procfs_cmdline[i] << " != " << argv[i] << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ TEST_F(PollTest, Nfds) {
|
||||
}
|
||||
|
||||
rlim_t max_fds = rlim.rlim_cur;
|
||||
std::cout << "Using limit: " << max_fds;
|
||||
std::cout << "Using limit: " << max_fds << std::endl;
|
||||
|
||||
// Create an eventfd. Since its value is initially zero, it is writable.
|
||||
FileDescriptor efd = ASSERT_NO_ERRNO_AND_VALUE(NewEventFD());
|
||||
|
||||
@@ -173,7 +173,7 @@ PosixErrorOr<std::vector<ProcPidSmapsEntry>> ParseProcPidSmaps(
|
||||
return;
|
||||
}
|
||||
unknown_fields.insert(std::string(key));
|
||||
std::cerr << "skipping unknown smaps field " << key;
|
||||
std::cerr << "skipping unknown smaps field " << key << std::endl;
|
||||
};
|
||||
|
||||
auto lines = absl::StrSplit(contents, '\n', absl::SkipEmpty());
|
||||
@@ -191,7 +191,7 @@ PosixErrorOr<std::vector<ProcPidSmapsEntry>> ParseProcPidSmaps(
|
||||
// amount of whitespace).
|
||||
if (!entry) {
|
||||
std::cerr << "smaps line not considered a maps line: "
|
||||
<< maybe_maps_entry.error_message();
|
||||
<< maybe_maps_entry.error_message() << std::endl;
|
||||
return PosixError(
|
||||
EINVAL,
|
||||
absl::StrCat("smaps field line without preceding maps line: ", l));
|
||||
|
||||
@@ -1188,7 +1188,7 @@ TEST(PtraceTest, SeizeSetOptions) {
|
||||
// gVisor is not susceptible to this race because
|
||||
// kernel.Task.waitCollectTraceeStopLocked() checks specifically for an
|
||||
// active ptraceStop, which is not initiated if SIGKILL is pending.
|
||||
std::cout << "Observed syscall-exit after SIGKILL";
|
||||
std::cout << "Observed syscall-exit after SIGKILL" << std::endl;
|
||||
ASSERT_THAT(waitpid(child_pid, &status, 0),
|
||||
SyscallSucceedsWithValue(child_pid));
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ TEST_P(SendFileTest, SendMultiple) {
|
||||
for (size_t sent = 0; sent < data.size(); cnt++) {
|
||||
const size_t remain = data.size() - sent;
|
||||
std::cout << "sendfile, size=" << data.size() << ", sent=" << sent
|
||||
<< ", remain=" << remain;
|
||||
<< ", remain=" << remain << std::endl;
|
||||
|
||||
// Send data and verify that sendfile returns the correct value.
|
||||
int res = sendfile(client.get(), inf.get(), nullptr, remain);
|
||||
|
||||
@@ -2212,7 +2212,7 @@ TEST_P(SocketMultiProtocolInetLoopbackTest, PortReuseTwoSockets) {
|
||||
setsockopt(fd2, SOL_SOCKET, SO_REUSEPORT, &portreuse2, sizeof(int)),
|
||||
SyscallSucceeds());
|
||||
|
||||
std::cout << portreuse1 << " " << portreuse2;
|
||||
std::cout << portreuse1 << " " << portreuse2 << std::endl;
|
||||
int ret = bind(fd2, reinterpret_cast<sockaddr*>(&addr), addrlen);
|
||||
|
||||
// Verify that two sockets can be bound to the same port only if
|
||||
|
||||
@@ -152,7 +152,7 @@ TEST(NetlinkRouteTest, GetLinkDump) {
|
||||
const struct ifinfomsg* msg =
|
||||
reinterpret_cast<const struct ifinfomsg*>(NLMSG_DATA(hdr));
|
||||
std::cout << "Found interface idx=" << msg->ifi_index
|
||||
<< ", type=" << std::hex << msg->ifi_type;
|
||||
<< ", type=" << std::hex << msg->ifi_type << std::endl;
|
||||
if (msg->ifi_type == ARPHRD_LOOPBACK) {
|
||||
loopbackFound = true;
|
||||
EXPECT_NE(msg->ifi_flags & IFF_LOOPBACK, 0);
|
||||
|
||||
@@ -63,13 +63,13 @@ PosixErrorOr<bool> CanCreateUserNamespace() {
|
||||
// is in a chroot environment (i.e., the caller's root directory does
|
||||
// not match the root directory of the mount namespace in which it
|
||||
// resides)."
|
||||
std::cerr << "clone(CLONE_NEWUSER) failed with EPERM";
|
||||
std::cerr << "clone(CLONE_NEWUSER) failed with EPERM" << std::endl;
|
||||
return false;
|
||||
} else if (errno == EUSERS) {
|
||||
// "(since Linux 3.11) CLONE_NEWUSER was specified in flags, and the call
|
||||
// would cause the limit on the number of nested user namespaces to be
|
||||
// exceeded. See user_namespaces(7)."
|
||||
std::cerr << "clone(CLONE_NEWUSER) failed with EUSERS";
|
||||
std::cerr << "clone(CLONE_NEWUSER) failed with EUSERS" << std::endl;
|
||||
return false;
|
||||
} else {
|
||||
// Unexpected error code; indicate an actual error.
|
||||
|
||||
Reference in New Issue
Block a user