aboutsummaryrefslogtreecommitdiffstats
path: root/csci4061/092120_breakout
diff options
context:
space:
mode:
authorMatthew Strapp <msattr@gmail.com>2020-10-26 08:12:34 -0500
committerMatthew Strapp <msattr@gmail.com>2020-10-26 08:12:34 -0500
commitd7afb98ca2d9ed18400310f42d3f3c8177959280 (patch)
tree600442970cb3afb8ab2f56f2a290cfe76d2d0d10 /csci4061/092120_breakout
parente (diff)
downloadhomework-d7afb98ca2d9ed18400310f42d3f3c8177959280.tar
homework-d7afb98ca2d9ed18400310f42d3f3c8177959280.tar.gz
homework-d7afb98ca2d9ed18400310f42d3f3c8177959280.tar.bz2
homework-d7afb98ca2d9ed18400310f42d3f3c8177959280.tar.lz
homework-d7afb98ca2d9ed18400310f42d3f3c8177959280.tar.xz
homework-d7afb98ca2d9ed18400310f42d3f3c8177959280.tar.zst
homework-d7afb98ca2d9ed18400310f42d3f3c8177959280.zip
Do breakouts
Diffstat (limited to '')
-rw-r--r--csci4061/092120_breakout/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/csci4061/092120_breakout/main.c b/csci4061/092120_breakout/main.c
index e5577dd..8d8e08d 100644
--- a/csci4061/092120_breakout/main.c
+++ b/csci4061/092120_breakout/main.c
@@ -26,8 +26,10 @@ int main(int argc, char **argv) {
pid_t pid;
for (int i=0; i<n; i++) {
pid = fork();
- if (pid != 0) {
- printf("%d\n", getpid());
+ if (pid == 0) {
+
+ } else {
+printf("%d\n", getpid());
execl("/bin/echo", "/bin/echo", "hello", "there", NULL);
}
}