Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
7a37578e
Commit
7a37578e
authored
18 years ago
by
rtm
Browse files
Options
Downloads
Patches
Plain Diff
clear killed flag in exit
idecref cwd in exit
parent
dfcc5b99
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
fs.c
+1
-1
1 addition, 1 deletion
fs.c
fstests.c
+6
-2
6 additions, 2 deletions
fstests.c
proc.c
+4
-0
4 additions, 0 deletions
proc.c
proc.h
+0
-5
0 additions, 5 deletions
proc.h
sh.c
+1
-1
1 addition, 1 deletion
sh.c
syscall.c
+0
-3
0 additions, 3 deletions
syscall.c
with
12 additions
and
12 deletions
fs.c
+
1
−
1
View file @
7a37578e
...
...
@@ -632,7 +632,7 @@ unlink(char *cp)
memset
(
&
de
,
0
,
sizeof
(
de
));
if
(
writei
(
dp
,
(
char
*
)
&
de
,
off
,
sizeof
(
de
))
!=
sizeof
(
de
))
panic
(
"unlink dir write"
);
iupdate
(
dp
);
iput
(
dp
);
...
...
This diff is collapsed.
Click to expand it.
fstests.c
+
6
−
2
View file @
7a37578e
...
...
@@ -150,8 +150,8 @@ createdelete()
}
if
(
pid
)
wa
it
();
else
ex
it
();
else
exit
();
for
(
i
=
0
;
i
<
n
;
i
++
){
...
...
@@ -160,8 +160,10 @@ createdelete()
fd
=
open
(
name
,
0
);
if
((
i
==
0
||
i
>=
n
/
2
)
&&
fd
<
0
){
printf
(
1
,
"oops createdelete %s didn't exist
\n
"
,
name
);
exit
();
}
else
if
((
i
>=
1
&&
i
<
n
/
2
)
&&
fd
>=
0
){
printf
(
1
,
"oops createdelete %s did exist
\n
"
,
name
);
exit
();
}
if
(
fd
>=
0
)
close
(
fd
);
...
...
@@ -171,8 +173,10 @@ createdelete()
fd
=
open
(
name
,
0
);
if
((
i
==
0
||
i
>=
n
/
2
)
&&
fd
<
0
){
printf
(
1
,
"oops createdelete %s didn't exist
\n
"
,
name
);
exit
();
}
else
if
((
i
>=
1
&&
i
<
n
/
2
)
&&
fd
>=
0
){
printf
(
1
,
"oops createdelete %s did exist
\n
"
,
name
);
exit
();
}
if
(
fd
>=
0
)
close
(
fd
);
...
...
This diff is collapsed.
Click to expand it.
proc.c
+
4
−
0
View file @
7a37578e
...
...
@@ -337,6 +337,9 @@ proc_exit(void)
cp
->
fds
[
fd
]
=
0
;
}
}
idecref
(
cp
->
cwd
);
cp
->
cwd
=
0
;
acquire
(
&
proc_table_lock
);
...
...
@@ -351,6 +354,7 @@ proc_exit(void)
p
->
ppid
=
1
;
// Jump into the scheduler, never to return.
cp
->
killed
=
0
;
cp
->
state
=
ZOMBIE
;
sched
();
panic
(
"zombie exit"
);
...
...
This diff is collapsed.
Click to expand it.
proc.h
+
0
−
5
View file @
7a37578e
...
...
@@ -46,12 +46,7 @@ struct proc{
int
killed
;
struct
fd
*
fds
[
NOFILE
];
struct
inode
*
cwd
;
uint
esp
;
// kernel stack pointer
uint
ebp
;
// kernel frame pointer
struct
jmpbuf
jmpbuf
;
struct
trapframe
*
tf
;
// points into kstack, used to find user regs
};
...
...
This diff is collapsed.
Click to expand it.
sh.c
+
1
−
1
View file @
7a37578e
...
...
@@ -22,7 +22,7 @@ char *argv[MAXARGS];
char
argv0buf
[
BUFSIZ
];
int
argc
;
int
debug
=
1
;
int
debug
=
0
;
int
parse
(
char
*
s
);
void
runcmd
(
void
);
...
...
This diff is collapsed.
Click to expand it.
syscall.c
+
0
−
3
View file @
7a37578e
...
...
@@ -113,7 +113,6 @@ sys_pipe(void)
return
0
;
oops:
cprintf
(
"sys_pipe failed
\n
"
);
if
(
rfd
)
fd_close
(
rfd
);
if
(
wfd
)
...
...
@@ -602,14 +601,12 @@ sys_exec(void)
return
0
;
bad:
cprintf
(
"exec failed early
\n
"
);
if
(
mem
)
kfree
(
mem
,
sz
);
iput
(
ip
);
return
-
1
;
bad2:
cprintf
(
"exec failed late
\n
"
);
iput
(
ip
);
proc_exit
();
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment