sysinfo;posix: ensure strings are quoted

This commit is contained in:
Danny Robson 2019-06-20 14:42:38 +10:00
parent 4edd8d8c3e
commit 83449cf8d2

View File

@ -30,14 +30,14 @@ cruft::util::operator<< (std::ostream &os, sysinfo const &)
struct utsname name; struct utsname name;
cruft::posix::error::try_code (uname (&name)); cruft::posix::error::try_code (uname (&name));
os << "os: { name: " << name.sysname << ", version: " << name.version os << "os: { name: '" << name.sysname << "', version: '" << name.version << "' }"
<< " }, hostname: " << name.nodename; << ", hostname: '" << name.nodename << '\'';
} }
{ {
auto const uid = geteuid (); auto const uid = geteuid ();
auto const user = getpwuid (uid); auto const user = getpwuid (uid);
os << ", username: " << user->pw_name; os << ", username: '" << user->pw_name << '\'';
} }
{ {