Misc QoL changes

- su: Preserve correct capacity to avoid vector reallocation
- su: Properly format code
- daemon: Remove useless `if`
- docs: Remove outdated info
This commit is contained in:
canyie
2022-04-29 23:44:02 +08:00
committed by John Wu
parent e88eed9a8d
commit 4f1a1879e5
6 changed files with 11 additions and 15 deletions
+1 -4
View File
@@ -283,10 +283,7 @@ static void switch_cgroup(const char *cgroup, int pid) {
if (fd == -1)
return;
snprintf(buf, sizeof(buf), "%d\n", pid);
if (xwrite(fd, buf, strlen(buf)) == -1) {
close(fd);
return;
}
xwrite(fd, buf, strlen(buf));
close(fd);
}