Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
a0e79372
Commit
a0e79372
authored
Sep 26, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6ar: exit with error status if files cannot be opened.
R=r DELTA=15 (8 added, 0 deleted, 7 changed) OCL=15952 CL=15954
parent
6270e70b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
ar.c
src/cmd/ar/ar.c
+15
-7
No files found.
src/cmd/ar/ar.c
View file @
a0e79372
...
...
@@ -121,6 +121,8 @@ int oflag;
int
uflag
;
int
vflag
;
int
errors
;
Arfile
*
astart
,
*
amiddle
,
*
aend
;
/* Temp file control block pointers */
int
allobj
=
1
;
/* set when all members are object files of the same type */
int
symdefsize
;
/* size of symdef file */
...
...
@@ -246,6 +248,8 @@ main(int argc, char *argv[])
}
argv
++
;
}
if
(
errors
)
cp
=
"error"
;
exits
(
cp
);
}
/*
...
...
@@ -307,8 +311,10 @@ rcmd(char *arname, int count, char **files)
}
bfile
=
Bopen
(
file
,
OREAD
);
if
(
!
bfile
)
{
if
(
count
!=
0
)
if
(
count
!=
0
)
{
fprint
(
2
,
"ar: cannot open %s
\n
"
,
file
);
errors
++
;
}
scanobj
(
&
bar
,
ap
,
bp
->
size
);
arcopy
(
&
bar
,
ap
,
bp
);
continue
;
...
...
@@ -339,9 +345,10 @@ rcmd(char *arname, int count, char **files)
continue
;
files
[
i
]
=
0
;
bfile
=
Bopen
(
file
,
OREAD
);
if
(
!
bfile
)
fprint
(
2
,
"ar: %s cannot open
\n
"
,
file
);
else
{
if
(
!
bfile
)
{
fprint
(
2
,
"ar: cannot open %s
\n
"
,
file
);
errors
++
;
}
else
{
mesg
(
'a'
,
file
);
d
=
dirfstat
(
Bfildes
(
bfile
));
if
(
d
==
nil
)
...
...
@@ -553,9 +560,10 @@ qcmd(char *arname, int count, char **files)
file
=
files
[
i
];
files
[
i
]
=
0
;
bfile
=
Bopen
(
file
,
OREAD
);
if
(
!
bfile
)
fprint
(
2
,
"ar: %s cannot open
\n
"
,
file
);
else
{
if
(
!
bfile
)
{
fprint
(
2
,
"ar: cannot open %s
\n
"
,
file
);
errors
++
;
}
else
{
mesg
(
'q'
,
file
);
armove
(
bfile
,
0
,
bp
);
if
(
!
arwrite
(
fd
,
bp
))
...
...
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