[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch for long procnames



 Hello...

 I'd like to suggest the following patch for the `long procnames'
stuff. the original stuff always cleared that information first but
didn't set it again if the call didn't result in a program load,
thus deleting this information for programs who just fork themselves.

 Explicitly deleting this information doesn't seem to be necessary
and watching for threads will also show programs that fork with a
new name.

 The following patch works much nicer for me...

ciao,
TeSche
--

--- dosmem.c.orig	Tue Jan 17 16:53:08 1995
+++ dosmem.c	Tue Jan 17 18:10:16 1995
@@ -584,8 +584,7 @@
 			base->links++;
 			env->links++;
 			if (text) text->links++;
-		}
-		else {
+		} else {
 			b->p_parent = curproc->base;
 			p = fork_proc();
 		}
@@ -600,23 +599,25 @@
 
 	/* jr: add Pexec information to PROC struct */
 		strncpy(p->cmdlin, b->p_cmdlin, 128);
-		p->fname[0] = 0;
-		if (mkload) {
+		if (mkload || (thread && ptr1)) {
 			char tmp[PATH_MAX];
 			char *source = ptr1;
 			tmp[1] = ':';
 			if (source[1] == ':') {
 				tmp[0] = source[0];
 				source += 2;
-			} else
+			} else {
 				tmp[0] = 'A' + curproc->curdrv;
-			if (DIRSEP(source[0]))	/* absolute path? */
-			{
+			}
+			if (DIRSEP(source[0])) {	/* absolute path? */
 				strncpy (&tmp[2], &source[0], PATH_MAX-2);
 				strcpy (p->fname, tmp);
 			} else {
-				if (! d_getcwd (&tmp[2], tmp[0] - 'A' + 1, PATH_MAX - 2))
+				if (!d_getcwd (&tmp[2], tmp[0] - 'A' + 1, PATH_MAX - 2)) {
 					ksprintf (p->fname, "%s\\%s", tmp, source);
+				} else {
+					ksprintf (p->fname, "%s", source);
+				}
 			}
 		}