Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
d4c64e5d
Commit
d4c64e5d
authored
18 years ago
by
rsc
Browse files
Options
Downloads
Patches
Plain Diff
writeable => writable
parent
48b82470
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
fd.c
+2
-2
2 additions, 2 deletions
fd.c
fd.h
+1
-1
1 addition, 1 deletion
fd.h
kalloc.c
+1
-1
1 addition, 1 deletion
kalloc.c
pipe.c
+4
-4
4 additions, 4 deletions
pipe.c
syscall.c
+3
-3
3 additions, 3 deletions
syscall.c
with
11 additions
and
11 deletions
fd.c
+
2
−
2
View file @
d4c64e5d
...
...
@@ -58,7 +58,7 @@ fd_alloc(void)
int
fd_write
(
struct
fd
*
fd
,
char
*
addr
,
int
n
)
{
if
(
fd
->
writ
e
able
==
0
)
if
(
fd
->
writable
==
0
)
return
-
1
;
if
(
fd
->
type
==
FD_PIPE
){
return
pipe_write
(
fd
->
pipe
,
addr
,
n
);
...
...
@@ -114,7 +114,7 @@ fd_close(struct fd *fd)
release
(
&
fd_table_lock
);
if
(
dummy
.
type
==
FD_PIPE
){
pipe_close
(
dummy
.
pipe
,
dummy
.
writ
e
able
);
pipe_close
(
dummy
.
pipe
,
dummy
.
writable
);
}
else
if
(
dummy
.
type
==
FD_FILE
){
idecref
(
dummy
.
ip
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
fd.h
+
1
−
1
View file @
d4c64e5d
...
...
@@ -2,7 +2,7 @@ struct fd {
enum
{
FD_CLOSED
,
FD_NONE
,
FD_PIPE
,
FD_FILE
}
type
;
int
ref
;
// reference count
char
readable
;
char
writ
e
able
;
char
writable
;
struct
pipe
*
pipe
;
struct
inode
*
ip
;
uint
off
;
...
...
This diff is collapsed.
Click to expand it.
kalloc.c
+
1
−
1
View file @
d4c64e5d
...
...
@@ -51,7 +51,7 @@ kfree(char *cp, int len)
if
(
len
%
PAGE
)
panic
(
"kfree"
);
//
XXX f
ill with junk to
help debug
//
F
ill with junk to
catch dangling refs.
for
(
i
=
0
;
i
<
len
;
i
++
)
cp
[
i
]
=
1
;
...
...
This diff is collapsed.
Click to expand it.
pipe.c
+
4
−
4
View file @
d4c64e5d
...
...
@@ -37,11 +37,11 @@ pipe_alloc(struct fd **fd1, struct fd **fd2)
initlock
(
&
p
->
lock
,
"pipe"
);
(
*
fd1
)
->
type
=
FD_PIPE
;
(
*
fd1
)
->
readable
=
1
;
(
*
fd1
)
->
writ
e
able
=
0
;
(
*
fd1
)
->
writable
=
0
;
(
*
fd1
)
->
pipe
=
p
;
(
*
fd2
)
->
type
=
FD_PIPE
;
(
*
fd2
)
->
readable
=
0
;
(
*
fd2
)
->
writ
e
able
=
1
;
(
*
fd2
)
->
writable
=
1
;
(
*
fd2
)
->
pipe
=
p
;
return
0
;
oops:
...
...
@@ -59,11 +59,11 @@ pipe_alloc(struct fd **fd1, struct fd **fd2)
}
void
pipe_close
(
struct
pipe
*
p
,
int
writ
e
able
)
pipe_close
(
struct
pipe
*
p
,
int
writable
)
{
acquire
(
&
p
->
lock
);
if
(
writ
e
able
){
if
(
writable
){
p
->
writeopen
=
0
;
wakeup
(
&
p
->
readp
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
syscall.c
+
3
−
3
View file @
d4c64e5d
...
...
@@ -260,13 +260,13 @@ sys_open(void)
fd
->
type
=
FD_FILE
;
if
(
arg1
&
O_RDWR
)
{
fd
->
readable
=
1
;
fd
->
writ
e
able
=
1
;
fd
->
writable
=
1
;
}
else
if
(
arg1
&
O_WRONLY
)
{
fd
->
readable
=
0
;
fd
->
writ
e
able
=
1
;
fd
->
writable
=
1
;
}
else
{
fd
->
readable
=
1
;
fd
->
writ
e
able
=
0
;
fd
->
writable
=
0
;
}
fd
->
ip
=
ip
;
fd
->
off
=
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