Commit 234191e5 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

pie/piegen: make -f explicit parameter

One may specify other parameters, but not 'f'.
Piegen should output usage() instead of trying to open "file.o"
as -f is explicit.
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent d51539cc
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "piegen.h" #include "piegen.h"
piegen_opt_t opts = { piegen_opt_t opts = {
.input_filename = "file.o", .input_filename = NULL,
.stream_name = "stream", .stream_name = "stream",
.prefix_name = "__", .prefix_name = "__",
.var_name = "elf_relocs", .var_name = "elf_relocs",
...@@ -116,6 +116,9 @@ int main(int argc, char *argv[]) ...@@ -116,6 +116,9 @@ int main(int argc, char *argv[])
} }
} }
if (!opts.input_filename)
goto usage;
fd = open(opts.input_filename, O_RDONLY); fd = open(opts.input_filename, O_RDONLY);
if (fd < 0) { if (fd < 0) {
pr_perror("Can't open file %s", opts.input_filename); pr_perror("Can't open file %s", opts.input_filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment