Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
7a307cad
Commit
7a307cad
authored
Sep 03, 2014
by
Steven Murray
Browse files
Revert "bug #105122: RFE: Add -f option to taped"
This reverts commit
efc1f045
.
parent
5e89dcb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
tape/taped.man
View file @
7a307cad
...
...
@@ -5,7 +5,7 @@
.SH NAME
taped \- starts the tape daemon
.SH SYNOPSIS
.B /usr/bin/taped
[-f|-h]
.B /usr/bin/taped
.SH DESCRIPTION
.LP
The
...
...
@@ -188,13 +188,6 @@ connected to AIX or Linux platforms, fast tape positionning is used.
.RE
.LP
If a tape drive supports several densities, there must be one line per density.
.SH OPTIONS
.TP
.BI -f
Remain in the foreground.
.TP
.BI -h
Print the usage message.
.SH FILES
.TP 1.5i
.B /etc/castor/castor.conf
...
...
tape/tpdaemon.c
View file @
7a307cad
...
...
@@ -459,107 +459,14 @@ int tpd_main() {
}
}
/**
* Determines whether or not the command line is valid.
*
* @return 1 if the command line is valid, else 0.
*/
int
cmd_line_is_valid
(
const
int
argc
,
const
char
*
const
*
const
argv
)
{
// If there are no command-line arguments
if
(
1
==
argc
)
{
return
1
;
// The command line is valid
}
// If there is one command-line argument and it is "-f"
if
(
2
==
argc
&&
0
==
strcmp
(
"-f"
,
argv
[
1
]))
{
return
1
;
// The command line is valid
}
// If there is one command-line argument and it is "-h"
if
(
2
==
argc
&&
0
==
strcmp
(
"-h"
,
argv
[
1
]))
{
return
1
;
// The command line is valid
}
// Reaching here means the command line is not valid
return
0
;
}
/**
* Determines whether or not the help/usage message of taped should be
* printed.
*
* @return 1 if the help/usage message should be printed, else 0.
*/
int
help_should_be_printed
(
const
int
argc
,
const
char
*
const
*
const
argv
)
{
int
i
=
0
;
// For each command-line argument
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
// Return 1 if the argument is "-h"
if
(
0
==
strcmp
(
"-h"
,
argv
[
i
]))
{
return
1
;
}
}
// Return 0 indicating "-h" was not found
return
0
;
}
/**
* Prints the command-line syntax of taped to the specified stream.
*
* @param stream The stream to be printed to.
*/
void
print_help
(
FILE
*
stream
)
{
fprintf
(
stream
,
"Usage:
\n
"
);
fprintf
(
stream
,
"
\t
taped [-f|-h]
\n
"
);
fprintf
(
stream
,
"
\n
"
);
fprintf
(
stream
,
"Where:
\n
"
);
fprintf
(
stream
,
"
\t
-f
\t
Remain in the foreground
\n
"
);
fprintf
(
stream
,
"
\t
-h
\t
Print this usage message
\n
"
);
fprintf
(
stream
,
"
\n
"
);
}
/**
* Determine whether or not the taped daemon should remain in the foreground.
*
* @return 1 if taped daemon should run in the foreground, else 0.
*/
int
taped_should_remain_in_the_foreground
(
const
int
argc
,
const
char
*
const
*
const
argv
)
{
int
i
=
0
;
// For each command-line argument
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
// Return 1 if the argument is "-f"
if
(
0
==
strcmp
(
"-f"
,
argv
[
i
]))
{
return
1
;
}
}
// Return 0 indicating "-f" was not found
return
0
;
}
int
main
(
const
int
argc
,
const
char
*
const
*
const
argv
)
{
if
(
!
cmd_line_is_valid
(
argc
,
argv
))
{
fprintf
(
stderr
,
"Invalid command-line arguments
\n\n
"
);
print_help
(
stderr
);
return
0
;
}
if
(
help_should_be_printed
(
argc
,
argv
))
{
print_help
(
stdout
);
return
0
;
}
if
(
!
taped_should_remain_in_the_foreground
(
argc
,
argv
))
{
if
((
maxfds
=
Cinitdaemon
(
"taped"
,
wait4child
))
<
0
)
{
return
1
;
}
}
return
tpd_main
();
int
main
(
int
argc
,
char
**
argv
)
{
(
void
)
argc
;
(
void
)
argv
;
if
((
maxfds
=
Cinitdaemon
(
"taped"
,
wait4child
))
<
0
)
exit
(
1
);
exit
(
tpd_main
());
}
int
chk_den
(
struct
tptab
*
tunp
,
...
...
Write
Preview
Supports
Markdown
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