mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump: rename ZG_ACTION_STDOUT to ZG_ACTION_COPY
With an upcoming patch the output target can be different to `stdout`. Therefore, the term `ZG_ACTION_STDOUT` is no longer generic enough. In addition, rename `do_write` to `do_copy` to match the enum name. Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
7567506cca
commit
e9d1e168b2
+3
-3
@@ -85,7 +85,7 @@ const char *OPTS_SELECT_ALL = "all";
|
||||
static void init_defaults(struct options *opts)
|
||||
{
|
||||
opts->prog_name = "zgetdump";
|
||||
opts->action = ZG_ACTION_STDOUT;
|
||||
opts->action = ZG_ACTION_COPY;
|
||||
#ifdef __s390x__
|
||||
opts->fmt = "elf";
|
||||
#else
|
||||
@@ -201,7 +201,7 @@ static void verify_opts(struct options *opts)
|
||||
{
|
||||
if (opts->select_specified) {
|
||||
if (opts->action != ZG_ACTION_MOUNT &&
|
||||
opts->action != ZG_ACTION_STDOUT &&
|
||||
opts->action != ZG_ACTION_COPY &&
|
||||
opts->action != ZG_ACTION_DUMP_INFO)
|
||||
ERR_EXIT("The \"--select\" option can only be "
|
||||
"specified for info, mount, or copy");
|
||||
@@ -228,7 +228,7 @@ static void parse_pos_args(struct options *opts, char *argv[], int argc)
|
||||
int pos_args = argc - optind;
|
||||
|
||||
switch (opts->action) {
|
||||
case ZG_ACTION_STDOUT:
|
||||
case ZG_ACTION_COPY:
|
||||
case ZG_ACTION_DUMP_INFO:
|
||||
case ZG_ACTION_DEVICE_INFO:
|
||||
if (pos_args == 0)
|
||||
|
||||
+1
-1
@@ -188,7 +188,7 @@ extern enum zg_type zg_type(struct zg_fh *zg_fh);
|
||||
* zgetdump actions
|
||||
*/
|
||||
enum zg_action {
|
||||
ZG_ACTION_STDOUT,
|
||||
ZG_ACTION_COPY,
|
||||
ZG_ACTION_DUMP_INFO,
|
||||
ZG_ACTION_DEVICE_INFO,
|
||||
ZG_ACTION_MOUNT,
|
||||
|
||||
+3
-3
@@ -159,7 +159,7 @@ static int do_mount(void)
|
||||
/*
|
||||
* Run "copy to stdout" action
|
||||
*/
|
||||
static int do_stdout(void)
|
||||
static int do_copy(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -184,8 +184,8 @@ int main(int argc, char *argv[])
|
||||
ERR_EXIT("Invalid target format \"%s\" specified", g.opts.fmt);
|
||||
|
||||
switch (g.opts.action) {
|
||||
case ZG_ACTION_STDOUT:
|
||||
return do_stdout();
|
||||
case ZG_ACTION_COPY:
|
||||
return do_copy();
|
||||
case ZG_ACTION_DUMP_INFO:
|
||||
return do_dump_info();
|
||||
case ZG_ACTION_DEVICE_INFO:
|
||||
|
||||
Reference in New Issue
Block a user