All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Khoronzhuk <ivan.khoronzhuk@gmail.com>
To: k-hagio-ab@nec.com, kexec@lists.infradead.org
Cc: Ivan Khoronzhuk <ikhoronz@cisco.com>
Subject: [RFC makedumpfile: add userinfo elf section 1/4] makedumpfile: rename check_dump_file() on check_file_is_writable()
Date: Wed,  1 Dec 2021 15:47:27 +0200	[thread overview]
Message-ID: <20211201134730.15943-2-ikhoronz@cisco.com> (raw)
In-Reply-To: <20211201134730.15943-1-ikhoronz@cisco.com>

Make function for checking the file can be written to be more flex
by renaming check_dump_file() on check_file_is_writable().

Signed-off-by: Ivan Khoronzhuk <ikhoronz@cisco.com>
---
 makedumpfile.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index 3d1d412..6b62b92 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -1397,7 +1397,7 @@ open_dump_file(void)
 }
 
 int
-check_dump_file(const char *path)
+check_file_is_writable(const char *path)
 {
 	char *err_str;
 
@@ -1410,7 +1410,7 @@ check_dump_file(const char *path)
 	} else {
 		err_str = strerror(EEXIST);
 	}
-	ERRMSG("Can't open the dump file (%s). %s\n", path, err_str);
+	ERRMSG("Can't open the file (%s). %s\n", path, err_str);
 	return FALSE;
 }
 
@@ -11954,7 +11954,7 @@ main(int argc, char *argv[])
 		if (info->flag_check_params)
 			goto check_ok;
 
-		if (!check_dump_file(info->name_dumpfile))
+		if (!check_file_is_writable(info->name_dumpfile))
 			goto out;
 
 		if (!open_files_for_rearranging_dumpdata())
@@ -11977,7 +11977,7 @@ main(int argc, char *argv[])
 		if (info->flag_check_params)
 			goto check_ok;
 
-		if (!check_dump_file(info->name_dumpfile))
+		if (!check_file_is_writable(info->name_dumpfile))
 			goto out;
 
 		if (!reassemble_dumpfile())
@@ -11993,7 +11993,7 @@ main(int argc, char *argv[])
 		if (info->flag_check_params)
 			goto check_ok;
 
-		if (!check_dump_file(info->name_dumpfile))
+		if (!check_file_is_writable(info->name_dumpfile))
 			goto out;
 		if (!dump_dmesg())
 			goto out;
@@ -12033,11 +12033,11 @@ main(int argc, char *argv[])
 		if (info->flag_split) {
 			for (i = 0; i < info->num_dumpfile; i++) {
 				SPLITTING_FD_BITMAP(i) = -1;
-				if (!check_dump_file(SPLITTING_DUMPFILE(i)))
+				if (!check_file_is_writable(SPLITTING_DUMPFILE(i)))
 					goto out;
 			}
 		} else {
-			if (!check_dump_file(info->name_dumpfile))
+			if (!check_file_is_writable(info->name_dumpfile))
 				goto out;
 		}
 
-- 
2.20.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2021-12-01 13:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 13:47 [RFC PATCH] makedumpfile: add userinfo elf section 0/4] Ivan Khoronzhuk
2021-12-01 13:47 ` Ivan Khoronzhuk [this message]
2021-12-01 13:47 ` [RFC makedumpfile: add userinfo elf section 2/4] elf: add new "userinfo" ELF section to traverse debug information Ivan Khoronzhuk
2021-12-01 13:47 ` [RFC makedumpfile: add userinfo elf section 3/4] elf_info: make int note_descsz() and offset_next_note() public Ivan Khoronzhuk
2021-12-01 13:47 ` [RFC makedumpfile: add userinfo elf section 4/4] elf: add ability to read the userinfo data from note segment Ivan Khoronzhuk
2021-12-15  0:58 ` [RFC PATCH] makedumpfile: add userinfo elf section 0/4] HAGIO KAZUHITO(萩尾 一仁)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211201134730.15943-2-ikhoronz@cisco.com \
    --to=ivan.khoronzhuk@gmail.com \
    --cc=ikhoronz@cisco.com \
    --cc=k-hagio-ab@nec.com \
    --cc=kexec@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.