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
89826f41
Commit
89826f41
authored
8 years ago
by
Frans Kaashoek
Browse files
Options
Downloads
Patches
Plain Diff
Check result of write (thans to Alexander Kapshuk <alexander.kapshuk@gmail)
parent
912575ad
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
cat.c
+6
-2
6 additions, 2 deletions
cat.c
with
6 additions
and
2 deletions
cat.c
+
6
−
2
View file @
89826f41
...
...
@@ -9,8 +9,12 @@ cat(int fd)
{
int
n
;
while
((
n
=
read
(
fd
,
buf
,
sizeof
(
buf
)))
>
0
)
write
(
1
,
buf
,
n
);
while
((
n
=
read
(
fd
,
buf
,
sizeof
(
buf
)))
>
0
)
{
if
(
write
(
1
,
buf
,
n
)
!=
n
)
{
printf
(
1
,
"cat: write error
\n
"
);
exit
();
}
}
if
(
n
<
0
){
printf
(
1
,
"cat: read error
\n
"
);
exit
();
...
...
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