2003-05-29 03:58:14

by Anton Blanchard

[permalink] [raw]
Subject: [PATCH] compat_wait4 fix


Hi,

sys_wait4 can return a pid and in this case we want to copy the struct
rusage out to userspace.

Anton

--- gr9/kernel/compat.c 2003-04-17 15:26:39.000000000 -0500
+++ gr9_cacheable_smp_h_2/kernel/compat.c 2003-05-28 21:29:06.000000000 -0500
@@ -362,8 +362,7 @@
ret = sys_wait4(pid, stat_addr ? &status : NULL, options, &r);
set_fs (old_fs);

- if (!ret)
- {
+ if (ret > 0) {
if (put_compat_rusage(ru, &r))
return -EFAULT;
if (stat_addr && put_user(status, stat_addr))