changed handling of the process not starting up so that
authorMark Linton <linton@ucbvax.Berkeley.EDU>
Tue, 9 Mar 1982 11:32:34 +0000 (03:32 -0800)
committerMark Linton <linton@ucbvax.Berkeley.EDU>
Tue, 9 Mar 1982 11:32:34 +0000 (03:32 -0800)
when "run < abc" is given where "abc" doesn't exist the right thing happens

SCCS-vsn: usr.bin/pascal/pdx/process/runcont.c 1.4
SCCS-vsn: usr.bin/pascal/pdx/process/start.c 1.7

usr/src/usr.bin/pascal/pdx/process/runcont.c
usr/src/usr.bin/pascal/pdx/process/start.c

index 2e8b4e7..a3fea21 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1982 Regents of the University of California */
 
 /* Copyright (c) 1982 Regents of the University of California */
 
-static char sccsid[] = "@(#)runcont.c 1.3 %G%";
+static char sccsid[] = "@(#)runcont.c 1.4 %G%";
 
 /*
  * Execution management.
 
 /*
  * Execution management.
@@ -117,6 +117,9 @@ initstart()
     process = &pbuf;
     initcache(process);
     start(argv, infile, outfile);
     process = &pbuf;
     initcache(process);
     start(argv, infile, outfile);
+    if (process->status != STOPPED) {
+       panic("could not start program");
+    }
 }
 
 /*
 }
 
 /*
@@ -129,9 +132,13 @@ run()
     curline = 0;
     argv[argc] = NIL;
     start(argv, infile, outfile);
     curline = 0;
     argv[argc] = NIL;
     start(argv, infile, outfile);
-    just_started = TRUE;
-    isstopped = FALSE;
-    cont();
+    if (process->status == STOPPED) {
+       just_started = TRUE;
+       isstopped = FALSE;
+       cont();
+    } else if (option('r')) {
+       panic("could not start program");
+    }
 }
 
 /*
 }
 
 /*
index f1fe693..32de7f2 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1982 Regents of the University of California */
 
 /* Copyright (c) 1982 Regents of the University of California */
 
-static char sccsid[] = "@(#)start.c 1.6 %G%";
+static char sccsid[] = "@(#)start.c 1.7 %G%";
 
 /*
  * Begin execution.
 
 /*
  * Begin execution.
@@ -77,8 +77,6 @@ char *infile, *outfile;
        if (objsize != 0) {
            addbp(lastaddr(), END_BP, NIL, NIL, NIL, 0);
        }
        if (objsize != 0) {
            addbp(lastaddr(), END_BP, NIL, NIL, NIL, 0);
        }
-    } else {
-       panic("could not start program");
     }
 }
 
     }
 }