summaryrefslogtreecommitdiffstats
path: root/source/ap/ash/patches/ash-ppid.patch
blob: 954b509d4a53de0b80e7dc734ecb87e96261afb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff -ur ash-0.4.0/var.c ash-0.4.0-ppid/var.c
--- ash-0.4.0/var.c	Tue Apr 24 01:23:17 2001
+++ ash-0.4.0-ppid/var.c	Tue Apr 24 01:22:07 2001
@@ -172,6 +172,7 @@
 	const struct varinit *ip;
 	struct var *vp;
 	struct var **vpp;
+	char ppid[30];
 
 	for (ip = varinit ; (vp = ip->var) != NULL ; ip++) {
 		if ((vp->flags & VEXPORT) == 0) {
@@ -193,6 +194,9 @@
 		vps1.text = strdup(geteuid() ? "PS1=$ " : "PS1=# ");
 		vps1.flags = VSTRFIXED|VTEXTFIXED;
 	}
+	
+	snprintf(ppid, 29, "%ld", (long)getppid());
+	setvar("PPID", ppid, VREADONLY|VNOFUNC);
 }
 
 /*