mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
* Sync with the trunk.
This commit is contained in:
commit
d66ea83a76
16 changed files with 107 additions and 34 deletions
|
@ -809,7 +809,8 @@ void killUser(uid_t uid)
|
|||
case 0:
|
||||
try { /* child */
|
||||
|
||||
if (setuid(uid) == -1) abort();
|
||||
if (setuid(uid) == -1)
|
||||
throw SysError("setting uid");
|
||||
|
||||
while (true) {
|
||||
if (kill(-1, SIGKILL) == 0) break;
|
||||
|
@ -819,7 +820,7 @@ void killUser(uid_t uid)
|
|||
}
|
||||
|
||||
} catch (std::exception & e) {
|
||||
std::cerr << format("killing processes beloging to uid `%1%': %1%")
|
||||
std::cerr << format("killing processes belonging to uid `%1%': %2%")
|
||||
% uid % e.what() << std::endl;
|
||||
quickExit(1);
|
||||
}
|
||||
|
@ -827,8 +828,9 @@ void killUser(uid_t uid)
|
|||
}
|
||||
|
||||
/* parent */
|
||||
if (pid.wait(true) != 0)
|
||||
throw Error(format("cannot kill processes for uid `%1%'") % uid);
|
||||
int status = pid.wait(true);
|
||||
if (status != 0)
|
||||
throw Error(format("cannot kill processes for uid `%1%': %2%") % uid % statusToString(status));
|
||||
|
||||
/* !!! We should really do some check to make sure that there are
|
||||
no processes left running under `uid', but there is no portable
|
||||
|
|
|
@ -91,6 +91,7 @@ void XMLWriter::writeAttrs(const XMLAttrs & attrs)
|
|||
char c = i->second[j];
|
||||
if (c == '"') output << """;
|
||||
else if (c == '<') output << "<";
|
||||
else if (c == '>') output << ">";
|
||||
else if (c == '&') output << "&";
|
||||
/* Escape newlines to prevent attribute normalisation (see
|
||||
XML spec, section 3.3.3. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue