summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_getcwd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-05-29 15:22:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-05-29 15:22:05 +0000
commitff458ec4674f1b5573db2f40b4a62c31cbe3e3ee (patch)
tree601d6c2a34bf7a31d11d0770da8abfdf81072746 /sys/kern/vfs_getcwd.c
parent176a5624327422e7899e7ae2d7d47754cb668ec5 (diff)
The past is fuzzy, but it appears during development of __getcwd, *retval
was used to return the length of the path, when the actual return value is 0. This would cause confusing results in ktrace. Diagnosed with beck since __realpath() picked up the same odd behaviour
Diffstat (limited to 'sys/kern/vfs_getcwd.c')
-rw-r--r--sys/kern/vfs_getcwd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/vfs_getcwd.c b/sys/kern/vfs_getcwd.c
index 2707c1dcdde..035d500cd5c 100644
--- a/sys/kern/vfs_getcwd.c
+++ b/sys/kern/vfs_getcwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_getcwd.c,v 1.32 2019/05/13 22:55:27 beck Exp $ */
+/* $OpenBSD: vfs_getcwd.c,v 1.33 2019/05/29 15:22:04 deraadt Exp $ */
/* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */
/*
@@ -420,7 +420,6 @@ sys___getcwd(struct proc *p, void *v, register_t *retval)
goto out;
lenused = bend - bp;
- *retval = lenused;
/* Put the result into user buffer */
error = copyout(bp, SCARG(uap, buf), lenused);