shithub: riscv

Download patch

ref: 9110ae6eaed8e36313d0b61860aeed4f1d12d3b7
parent: 2acb02f29ba24f3fed9bb3b8b0e0d870181eef50
author: cinap_lenrek <[email protected]>
date: Thu Aug 6 05:09:57 EDT 2015

kernel: make shargs() function static in sysproc.c

--- a/sys/src/9/port/sysproc.c
+++ b/sys/src/9/port/sysproc.c
@@ -9,8 +9,6 @@
 
 #include	<a.out.h>
 
-int	shargs(char*, int, char**);
-
 extern void checkpages(void);
 extern void checkpagerefs(void);
 
@@ -224,6 +222,38 @@
 	return pid;
 }
 
+static int
+shargs(char *s, int n, char **ap)
+{
+	int i;
+
+	s += 2;
+	n -= 2;		/* skip #! */
+	for(i=0;; i++){
+		if(i >= n)
+			return 0;
+		if(s[i]=='\n')
+			break;
+	}
+	s[i] = 0;
+
+	i = 0;
+	for(;;) {
+		while(*s==' ' || *s=='\t')
+			s++;
+		if(*s == 0)
+			break;
+		ap[i++] = s++;
+		while(*s && *s!=' ' && *s!='\t')
+			s++;
+		if(*s == 0)
+			break;
+		*s++ = 0;
+	}
+	ap[i] = nil;
+	return i;
+}
+
 static ulong
 l2be(long l)
 {
@@ -533,38 +563,6 @@
 	if(up->hang)
 		up->procctl = Proc_stopme;
 	return execregs(entry, ssize, nargs);
-}
-
-int
-shargs(char *s, int n, char **ap)
-{
-	int i;
-
-	s += 2;
-	n -= 2;		/* skip #! */
-	for(i=0;; i++){
-		if(i >= n)
-			return 0;
-		if(s[i]=='\n')
-			break;
-	}
-	s[i] = 0;
-
-	i = 0;
-	for(;;) {
-		while(*s==' ' || *s=='\t')
-			s++;
-		if(*s == 0)
-			break;
-		ap[i++] = s++;
-		while(*s && *s!=' ' && *s!='\t')
-			s++;
-		if(*s == 0)
-			break;
-		*s++ = 0;
-	}
-	ap[i] = nil;
-	return i;
 }
 
 int