summaryrefslogtreecommitdiffstats
path: root/cli_classic.c
diff options
context:
space:
mode:
authorThomas Heijligen <thomas.heijligen@secunet.com>2022-04-07 17:48:53 +0200
committerNico Huber <nico.h@gmx.de>2022-04-13 11:45:56 +0000
commit50cd432c7462652ffb24441fea1a244264638539 (patch)
treeb36aa129ebc8599075962fcfe0b2c779c5b08182 /cli_classic.c
parent48fef95b79920611ba284a946d5950b8afeeb38b (diff)
downloadflashrom-50cd432c7462652ffb24441fea1a244264638539.tar.gz
flashrom-50cd432c7462652ffb24441fea1a244264638539.tar.bz2
flashrom-50cd432c7462652ffb24441fea1a244264638539.zip
Drop STANDALONE mode
STANDALONE mode was used to build flashrom without having support for file handling. This was relevant to build libflashrom on top of libpayload. For a while now, the code which is covered by STANDALONE has moved to cli_*.c and is not used for libflashrom. Therefore we can drop STANDALONE mode. Change-Id: I58fb82270a9884a323d9850176708d230fdc5165 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/63469 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'cli_classic.c')
-rw-r--r--cli_classic.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/cli_classic.c b/cli_classic.c
index 0b6e79c32..c543ff7eb 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -112,12 +112,10 @@ static int check_filename(char *filename, const char *type)
/* Ensure a file is open by means of fstat */
static bool check_file(FILE *file)
{
-#ifndef STANDALONE
struct stat statbuf;
if (fstat(fileno(file), &statbuf) < 0)
return false;
-#endif /* !STANDALONE */
return true;
}
@@ -279,9 +277,7 @@ int main(int argc, char *argv[])
char *referencefile = NULL;
char *layoutfile = NULL;
char *fmapfile = NULL;
-#ifndef STANDALONE
char *logfile = NULL;
-#endif /* !STANDALONE */
char *tempstr = NULL;
char *pparam = NULL;
struct layout_include_args *include_args = NULL;
@@ -481,9 +477,6 @@ int main(int argc, char *argv[])
exit(0);
break;
case 'o':
-#ifdef STANDALONE
- cli_classic_abort_usage("Log file not supported in standalone mode. Aborting.\n");
-#else /* STANDALONE */
if (logfile) {
fprintf(stderr, "Warning: -o/--output specified multiple times.\n");
free(logfile);
@@ -493,7 +486,6 @@ int main(int argc, char *argv[])
if (logfile[0] == '\0') {
cli_classic_abort_usage("No log filename specified.\n");
}
-#endif /* STANDALONE */
break;
default:
cli_classic_abort_usage(NULL);
@@ -511,13 +503,10 @@ int main(int argc, char *argv[])
cli_classic_abort_usage(NULL);
if (referencefile && check_filename(referencefile, "reference"))
cli_classic_abort_usage(NULL);
-
-#ifndef STANDALONE
if (logfile && check_filename(logfile, "log"))
cli_classic_abort_usage(NULL);
if (logfile && open_logfile(logfile))
cli_classic_abort_usage(NULL);
-#endif /* !STANDALONE */
#if CONFIG_PRINT_WIKI == 1
if (list_supported_wiki) {
@@ -532,9 +521,7 @@ int main(int argc, char *argv[])
goto out;
}
-#ifndef STANDALONE
start_logging();
-#endif /* !STANDALONE */
print_buildinfo();
msg_gdbg("Command line (%i args):", argc - 1);
@@ -808,9 +795,7 @@ out:
/* clean up global variables */
free((char *)chip_to_probe); /* Silence! Freeing is not modifying contents. */
chip_to_probe = NULL;
-#ifndef STANDALONE
free(logfile);
ret |= close_logfile();
-#endif /* !STANDALONE */
return ret;
}