aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorDrew DeVault <ddevault@linode.com>2016-04-29 11:01:49 -0400
committerDrew DeVault <ddevault@linode.com>2016-04-29 11:01:49 -0400
commit3be38674744c59bafe6cd249169884940a88fd55 (patch)
treeea1655a34e8b35e86357a50c72ee13843a64b78c /sway/commands.c
parentebdce719b4497302d373c065dd88f1071e907b5f (diff)
Fix oversight in ebdce71
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 3092239c..64cd0dc8 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -526,7 +526,7 @@ static struct cmd_results *cmd_exec_always(int argc, char **argv) {
close(fd[0]);
ssize_t s = 0;
while ((size_t)s < sizeof(pid_t)) {
- s += write(fd[1], ((uint8_t *)child) + s, sizeof(pid_t));
+ s += write(fd[1], ((uint8_t *)child) + s, sizeof(pid_t) - s);
}
close(fd[1]);
_exit(0); // Close child process
@@ -536,7 +536,7 @@ static struct cmd_results *cmd_exec_always(int argc, char **argv) {
close(fd[1]); // close write
ssize_t s = 0;
while ((size_t)s < sizeof(pid_t)) {
- s += read(fd[0], ((uint8_t *)child) + s, sizeof(pid_t));
+ s += read(fd[0], ((uint8_t *)child) + s, sizeof(pid_t) - s);
}
close(fd[0]);
// cleanup child process