Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
27b6e936
Commit
27b6e936
authored
Nov 05, 2010
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in assignment 3 (fork/pipe) of OS.
parent
f3205726
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
3 deletions
+23
-3
os/ass3/.gitignore
os/ass3/.gitignore
+1
-0
os/ass3/Makefile
os/ass3/Makefile
+1
-1
os/ass3/fishbones.c
os/ass3/fishbones.c
+3
-2
os/ass3/screenrc
os/ass3/screenrc
+9
-0
os/ass3/view-logs.bash
os/ass3/view-logs.bash
+9
-0
No files found.
os/ass3/.gitignore
View file @
27b6e936
...
...
@@ -2,3 +2,4 @@
child.log*
*.swp
fishbones
fish
os/ass3/Makefile
View file @
27b6e936
PROG
=
fish
CC
=
gcc
CFLAGS
=
-std
=
gnu99
-pedantic
-Wall
-Wextra
-O3
CFLAGS
=
-std
=
c99
-pedantic
-Wall
-Wextra
-O3
-D_POSIX_SOURCE
OFILES
=
fishbones.o
RM
=
rm
-f
...
...
os/ass3/fishbones.c
View file @
27b6e936
...
...
@@ -69,7 +69,8 @@ static void gup(FILE * log1, FILE * log2, int pipe_id[2], int myNumber)
fprintf
(
log1
,
"antidote used (%d left)
\n
"
,
antidote
);
fprintf
(
log2
,
"antidote used (%d left)
\n
"
,
antidote
);
fprintf
(
log3
,
"antidote used (%d left)
\n
"
,
antidote
);
break
;
break
;
}
}
else
if
(
c
==
'A'
)
{
...
...
@@ -193,7 +194,7 @@ main(int argc, char * argv[])
perror
(
"Child could not be created
\n
"
);
exit
(
1
);
case
0
:
gup
(
log1
,
log2
,
pipe_id
,
child_id
);
gup
(
log1
,
log2
,
pipe_id
,
kiddoCount
);
break
;
default:
puts
(
"Parent process continuing..."
);
...
...
os/ass3/screenrc
0 → 100644
View file @
27b6e936
bindkey ^c at "#" kill
split -v
screen watch cat child.log1
focus
split -v
screen watch cat child.log2
focus
screen watch cat child.log3
os/ass3/view-logs.bash
0 → 100755
View file @
27b6e936
#!/bin/bash
if
[
"
`
which screen
`
"
=
''
]
;
then
echo
"GNU screen is missing. I'll now trying to install screen using apt-get."
;
echo
"The installation of GNU screen requires sudo-rights: "
;
sudo
apt-get
install
screen
;
fi
;
screen
-c
screenrc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment