summaryrefslogtreecommitdiff
path: root/sys/src/9/port/sysproc.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-10-12 11:30:42 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2021-10-12 11:30:42 +0000
commit03d870e0283299404b0eb46689d13f8538e83a2f (patch)
treea4e9cce06b75f06aaeffb74c53b9c0ea5804621c /sys/src/9/port/sysproc.c
parentb3c3c3e63df2958dfc3f972abefa8f892d8345d3 (diff)
kernel: return error from sysrfork instead of waiting and retrying
The old strategy of wait and retry doesnt seem to work very well as it keeps all the forking parents stuck waiting in the kernel worsening the situation. The idea with this change is to have rfork() return error quickly; and without whining; as most callers would just react with a sysfatal() which might be better for surviving this.
Diffstat (limited to 'sys/src/9/port/sysproc.c')
-rw-r--r--sys/src/9/port/sysproc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/src/9/port/sysproc.c b/sys/src/9/port/sysproc.c
index 6e0af5332..f451e047d 100644
--- a/sys/src/9/port/sysproc.c
+++ b/sys/src/9/port/sysproc.c
@@ -84,7 +84,8 @@ sysrfork(va_list list)
return 0;
}
- p = newproc();
+ if((p = newproc()) == nil)
+ error("no procs");
qlock(&p->debug);