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
f3e87bc8
Commit
f3e87bc8
authored
16 years ago
by
kolya
Browse files
Options
Downloads
Patches
Plain Diff
make mkdir crash-safer, as noticed by many students on midterm
parent
e1626709
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sysfile.c
+11
-7
11 additions, 7 deletions
sysfile.c
with
11 additions
and
7 deletions
sysfile.c
+
11
−
7
View file @
f3e87bc8
...
...
@@ -237,13 +237,6 @@ create(char *path, int canexist, short type, short major, short minor)
ip
->
minor
=
minor
;
ip
->
nlink
=
1
;
iupdate
(
ip
);
if
(
dirlink
(
dp
,
name
,
ip
->
inum
)
<
0
){
ip
->
nlink
=
0
;
iunlockput
(
ip
);
iunlockput
(
dp
);
return
0
;
}
if
(
type
==
T_DIR
){
// Create . and .. entries.
dp
->
nlink
++
;
// for ".."
...
...
@@ -252,6 +245,17 @@ create(char *path, int canexist, short type, short major, short minor)
if
(
dirlink
(
ip
,
"."
,
ip
->
inum
)
<
0
||
dirlink
(
ip
,
".."
,
dp
->
inum
)
<
0
)
panic
(
"create dots"
);
}
if
(
dirlink
(
dp
,
name
,
ip
->
inum
)
<
0
){
dp
->
nlink
--
;
iupdate
(
dp
);
iunlockput
(
dp
);
ip
->
nlink
=
0
;
iunlockput
(
ip
);
return
0
;
}
iunlockput
(
dp
);
return
ip
;
}
...
...
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