]> Zhao Yanbai Git Server - minix.git/commitdiff
Changed kernel process table format affected ps.
authorJorrit Herder <jnherder@minix3.org>
Fri, 24 Jun 2005 16:19:21 +0000 (16:19 +0000)
committerJorrit Herder <jnherder@minix3.org>
Fri, 24 Jun 2005 16:19:21 +0000 (16:19 +0000)
New mkdep.sh script and affected Makefile.

commands/ps/ps.c
commands/scripts/Makefile
commands/scripts/mkdep.sh [new file with mode: 0644]

index 2c97f4e29b5bfdb49fb3afd2133f82fabda93362..5438f86cd8b39b3ab4a0a3fdfce3e7696bc5b4d5 100644 (file)
@@ -461,7 +461,7 @@ struct pstat *bufp;
 
   if (p_nr < -nr_tasks || p_nr >= nr_procs) return -1;
 
-  if ((ps_proc[p_ki].p_type == P_NONE)
+  if ((ps_proc[p_ki].p_flags == SLOT_FREE)
                                && !(ps_mproc[p_nr].mp_flags & IN_USE))
        return -1;
 
index 7da3de61b554c86faa1add1e56104c9da7606ef5..aa948baae49d25d42ea3e09f830ba2e64c24996a 100755 (executable)
@@ -31,6 +31,7 @@ usr:  \
        /usr/bin/clear \
                /usr/bin/clr \
        /usr/bin/makewhatis \
+       /usr/bin/mkdep \
        /usr/bin/mkdist \
        /usr/bin/setup \
        /usr/bin/spell \
@@ -94,6 +95,9 @@ clean:
 /usr/bin/makewhatis:   makewhatis.sh
        install -m 755 -c -o bin $? $@
 
+/usr/bin/mkdep:        mkdep.sh
+       install -m 755 -c -o bin $? $@
+
 /usr/bin/mkdist:       mkdist.sh
        install -m 755 -c -o bin $? $@
 
diff --git a/commands/scripts/mkdep.sh b/commands/scripts/mkdep.sh
new file mode 100644 (file)
index 0000000..6b5fc7d
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+#      mkdep 1.1 - Generate Makefile dependencies.     Author: Kees J. Bot
+#
+# Does what 'cc -M' should do, but no compiler gets it right, they all
+# strip the leading path of the '.o' file.)
+#
+# Added option to generate .depend files in subdirectories of given dir.
+#                                                      Jorrit N. Herder
+
+case $# in
+
+# Display help ...
+0)     
+       echo "Usage: mkdep 'cpp command' file ..." >&2
+       echo "       mkdep directory" >&2
+;;
+
+# Create .depend files ...
+1)
+       echo "Creating .depend files in $1"
+       for dir in `find $1 -type d ! -name CVS`
+       do
+               touch $dir/.depend
+       done
+
+;;
+
+
+# Get dependencies ... 
+*)
+       cpp="$1"; shift
+
+       for f
+       do
+               : < "$f" || exit
+
+               o=`expr "$f" : '\(.*\)\..*'`.o
+
+               echo
+
+               $cpp "$f" | \
+                       sed -e '/^#/!d
+                               s/.*"\(.*\)".*/\1/
+                               s:^\./::' \
+                           -e "s:^:$o\:        :" | \
+                       sort -u
+       done
+esac
+
+exit 0
+
+#
+# $PchId: mkdep.sh,v 1.3 1998/07/23 21:24:38 philip Exp $
+#