mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
It is unusual to write the file output from a tool to stdout. Therefore add a positional argument to the zgetdump convert action where the output file can be specified. If no positional argument is given the output is written to stdout as before and therefore there is no change in the default behavior. If the file output already exists an error is returned. The reason for this is to avoid the situation where an existing dump is accidentally overwritten by the user. 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>
41 lines
835 B
C
41 lines
835 B
C
/*
|
|
* Copyright IBM Corp. 2001, 2018
|
|
*
|
|
* s390-tools is free software; you can redistribute it and/or modify
|
|
* it under the terms of the MIT license. See LICENSE for details.
|
|
*/
|
|
|
|
#ifndef OPTS_H
|
|
#define OPTS_H
|
|
|
|
#include "zg.h"
|
|
|
|
/*
|
|
* zgetdump options
|
|
*/
|
|
struct options {
|
|
const char *prog_name;
|
|
int action_specified;
|
|
enum zg_action action;
|
|
char *device;
|
|
/* If `output_path == NULL` the output is written to `stdout` */
|
|
const char *output_path;
|
|
char *mount_point;
|
|
int fmt_specified;
|
|
const char *fmt;
|
|
int debug_specified;
|
|
char **argv_fuse;
|
|
int argc_fuse;
|
|
const char *select;
|
|
int select_specified;
|
|
int verbose;
|
|
};
|
|
|
|
extern const char *OPTS_SELECT_KDUMP;
|
|
extern const char *OPTS_SELECT_PROD;
|
|
extern const char *OPTS_SELECT_ALL;
|
|
|
|
void opts_parse(int argc, char *argv[], struct options *opts);
|
|
|
|
#endif /* OPTS_H */
|