]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
x86/vdso/vdso2c: Correct error messages on file open
authorDmitry Safonov <dima@arista.com>
Mon, 20 Apr 2020 18:32:53 +0000 (19:32 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 21 Apr 2020 18:33:16 +0000 (20:33 +0200)
err() message in main() is misleading: it should print `outfilename`,
which is argv[3], not argv[2].

Correct error messages to be more precise about what failed and for
which file.

Co-developed-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Andy Lutomirski <luto@kernel.org>
Link: https://lkml.kernel.org/r/20200420183256.660371-2-dima@arista.com
arch/x86/entry/vdso/vdso2c.c

index 3842873b3ae3b6c5af587544e8e4c4804ea1f3af..7380908045c7805ebf98b568a11d4c591aafdaf1 100644 (file)
@@ -187,7 +187,7 @@ static void map_input(const char *name, void **addr, size_t *len, int prot)
 
        int fd = open(name, O_RDONLY);
        if (fd == -1)
-               err(1, "%s", name);
+               err(1, "open(%s)", name);
 
        tmp_len = lseek(fd, 0, SEEK_END);
        if (tmp_len == (off_t)-1)
@@ -240,7 +240,7 @@ int main(int argc, char **argv)
        outfilename = argv[3];
        outfile = fopen(outfilename, "w");
        if (!outfile)
-               err(1, "%s", argv[2]);
+               err(1, "fopen(%s)", outfilename);
 
        go(raw_addr, raw_len, stripped_addr, stripped_len, outfile, name);