Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
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
dCache
cta
Commits
e9ebc0c1
Commit
e9ebc0c1
authored
11 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
bug #102831: RFE: Remove the reason argument from tpconfig
Fixed in the master branch.
parent
2ac01de9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tape/tpconfig.c
+14
-28
14 additions, 28 deletions
tape/tpconfig.c
tape/tpconfig.man
+1
-49
1 addition, 49 deletions
tape/tpconfig.man
with
15 additions
and
77 deletions
tape/tpconfig.c
+
14
−
28
View file @
e9ebc0c1
...
...
@@ -37,21 +37,22 @@ struct confrsn confuprsn[] = {
{
"ops"
,
TPCU_OPS
}
};
void
usage
(
char
*
cmd
)
static
void
tpconfig_
usage
(
char
*
cmd
)
{
fprintf
(
stderr
,
"usage: %s "
,
cmd
);
fprintf
(
stderr
,
"unit_name status
[reason]
\n
"
);
fprintf
(
stderr
,
"unit_name status
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
unsigned
int
n
;
int
reason
;
int
status
;
if
(
argc
!=
3
&&
argc
!=
4
)
{
usage
(
argv
[
0
]);
if
(
argc
!=
3
)
{
fprintf
(
stderr
,
"Wrong number of command-line arguments"
": expected 2, actual was %d
\n
"
,
(
argc
-
1
));
tpconfig_usage
(
argv
[
0
]);
exit
(
USERR
);
}
if
(
strcmp
(
argv
[
2
],
"up"
)
==
0
)
{
...
...
@@ -61,36 +62,21 @@ int main(int argc,
status
=
CONF_DOWN
;
reason
=
TPCD_OPS
;
}
else
{
usage
(
argv
[
0
]);
fprintf
(
stderr
,
"Invalid status"
": expected up or down, actual was %s
\n
"
,
argv
[
2
]);
tpconfig_usage
(
argv
[
0
]);
exit
(
USERR
);
}
if
(
argc
==
4
)
{
if
(
status
==
CONF_UP
)
{
for
(
n
=
0
;
n
<
sizeof
(
confuprsn
)
/
sizeof
(
struct
confrsn
);
n
++
)
if
(
strcmp
(
argv
[
3
],
confuprsn
[
n
].
text
)
==
0
)
break
;
if
(
n
==
sizeof
(
confuprsn
)
/
sizeof
(
struct
confrsn
))
{
fprintf
(
stderr
,
TP059
);
exit
(
USERR
);
}
reason
=
confuprsn
[
n
].
code
;
}
else
{
for
(
n
=
0
;
n
<
sizeof
(
confdnrsn
)
/
sizeof
(
struct
confrsn
);
n
++
)
if
(
strcmp
(
argv
[
3
],
confdnrsn
[
n
].
text
)
==
0
)
break
;
if
(
n
==
sizeof
(
confdnrsn
)
/
sizeof
(
struct
confrsn
))
{
fprintf
(
stderr
,
TP059
);
exit
(
USERR
);
}
reason
=
confdnrsn
[
n
].
code
;
}
}
if
(
Ctape_config
(
argv
[
1
],
status
,
reason
)
<
0
)
{
fprintf
(
stderr
,
TP009
,
argv
[
1
],
sstrerror
(
serrno
));
if
(
serrno
==
EINVAL
||
serrno
==
ETIDN
)
if
(
serrno
==
EINVAL
||
serrno
==
ETIDN
)
{
exit
(
USERR
);
else
}
else
{
exit
(
SYERR
);
}
else
}
}
else
{
exit
(
0
);
}
}
This diff is collapsed.
Click to expand it.
tape/tpconfig.man
+
1
−
49
View file @
e9ebc0c1
...
...
@@ -7,7 +7,6 @@ tpconfig \- configure tape drive up/down
.SH SYNOPSIS
.B tpconfig
.I drive_name drive_status
.RI [ reason ]
.SH DESCRIPTION
.B tpconfig
configures drive up or down. This tells the tape daemon if the drive
...
...
@@ -26,58 +25,11 @@ can be
.B up
or
.BR down .
.TP
.I reason
is an optional alphanumeric string:
.LP
When
.I drive_status
is
.BR down ,
.I reason
may be one of the following:
.RS
.TP
.B cleaning
.TP
.B test
.TP
.B failure
.TP
.B system
.TP
.B suspect
.TP
.B upgrade
.TP
.B ops
.RE
.LP
When
.I drive_status
is
.BR up ,
.I reason
may be one of the following:
.RS
.TP
.B cleaned
.TP
.B replaced
.TP
.B repaired
.TP
.B preventive
.TP
.B upgraded
.TP
.B ops
.RE
.SH EXAMPLE
.nf
.ft CW
tpconfig dlt02@shd34 up
cleaned
tpconfig dlt02@shd34 up
.ft
.fi
.SH EXIT STATUS
...
...
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