mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
With gcc 7 we get warnings like the following:
fdasd.c: In function 'main':
fdasd.c:3055:4: warning: this statement may fall through
[-Wimplicit-fallthrough=]
fdasd_exit(&anchor, 0);
^~~~~~~~~~~~~~~~~~~~~~
fdasd.c:3056:3: note: here
default:
^~~~~~~
Fix this by marking functions with "__noreturn" to help gcc.
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
54 lines
1.1 KiB
C
54 lines
1.1 KiB
C
/*
|
|
* ipl_tools - Linux for System z reipl and shutdown tools
|
|
*
|
|
* Main functions
|
|
*
|
|
* Copyright IBM Corp. 2008, 2017
|
|
*
|
|
* s390-tools is free software; you can redistribute it and/or modify
|
|
* it under the terms of the MIT license. See LICENSE for details.
|
|
*/
|
|
|
|
#include "lib/zt_common.h"
|
|
#include "ipl_tools.h"
|
|
|
|
struct globals g;
|
|
|
|
void __noreturn print_help_hint_exit(void)
|
|
{
|
|
fprintf(stderr, "Try '%s' --help' for more information.\n",
|
|
g.prog_name);
|
|
exit(1);
|
|
}
|
|
|
|
void __noreturn print_version_exit(void)
|
|
{
|
|
printf("%s: Linux on System z shutdown actions version %s\n",
|
|
g.prog_name, RELEASE_STRING);
|
|
printf("Copyright IBM Corp. 2008, 2017\n");
|
|
exit(0);
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
strncpy(g.prog_name, argv[0], sizeof(g.prog_name));
|
|
if (strstr(argv[0], "chreipl") != NULL) {
|
|
cmd_chreipl(argc, argv);
|
|
return 0;
|
|
}
|
|
if (strstr(argv[0], "chshut") != NULL) {
|
|
cmd_chshut(argc, argv);
|
|
return 0;
|
|
}
|
|
if (strstr(argv[0], "lsreipl") != NULL) {
|
|
cmd_lsreipl(argc, argv);
|
|
return 0;
|
|
}
|
|
if (strstr(argv[0], "lsshut") != NULL) {
|
|
cmd_lsshut(argc, argv);
|
|
return 0;
|
|
}
|
|
ERR_EXIT("Invalid program name \"%s\"", argv[0]);
|
|
return 1;
|
|
}
|