code: plan9front

Download patch

ref: 58e6750401684c25a82c42c4edb5001a814f6d31
parent: eb1dfed9abb054e4708fcb13ac6d8d537914ac77
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Dec 19 13:07:12 EST 2020

kernel: remove Proc* argument from procsetuser() function

--- a/sys/src/9/port/auth.c
+++ b/sys/src/9/port/auth.c
@@ -116,7 +116,7 @@
 {
 	if(n!=4 || strncmp(a, "none", 4)!=0)
 		error(Eperm);
-	procsetuser(up, "none");
+	procsetuser("none");
 	return n;
 }
 
@@ -143,7 +143,7 @@
 	srvrenameuser(eve, buf);
 	shrrenameuser(eve, buf);
 	kstrdup(&eve, buf);
-	procsetuser(up, buf);
+	procsetuser(buf);
 	return n;
 }
 
--- a/sys/src/9/port/devcap.c
+++ b/sys/src/9/port/devcap.c
@@ -246,7 +246,7 @@
 		}
 		secfree(p);
 
-		procsetuser(up, to);
+		procsetuser(to);
 
 		secfree(cp);
 		poperror();
--- a/sys/src/9/port/portfns.h
+++ b/sys/src/9/port/portfns.h
@@ -244,7 +244,7 @@
 void		procinit0(void);
 ulong		procpagecount(Proc*);
 void		procpriority(Proc*, int, int);
-void		procsetuser(Proc*, char*);
+void		procsetuser(char*);
 Proc*		proctab(int);
 extern void	(*proctrace)(Proc*, int, vlong); 
 void		procwired(Proc*, int);
--- a/sys/src/9/port/proc.c
+++ b/sys/src/9/port/proc.c
@@ -1608,12 +1608,12 @@
 }
 
 void
-procsetuser(Proc *p, char *new)
+procsetuser(char *new)
 {
-	qlock(&p->debug);
-	kstrdup(&p->user, new);
-	p->basepri = PriNormal;
-	qunlock(&p->debug);
+	qlock(&up->debug);
+	kstrdup(&up->user, new);
+	up->basepri = PriNormal;
+	qunlock(&up->debug);
 }
 
 /*