From: Larry Doolittle <ldoolitt@recycle.lbl.gov>
To: linux-mtd@lists.infradead.org
Subject: minor einfo and mtd_debug improvement
Date: Fri, 5 Oct 2001 11:37:11 -0700 [thread overview]
Message-ID: <20011005113711.A29087@recycle.lbl.gov> (raw)
The following changes let einfo and mtd_debug do the right
thing when the underlying MTD device is marked readonly.
- Larry
diff -ur mtd-util-20011003/einfo.c /home/ldoolitt/cvs/mtd/util/einfo.c
--- mtd-util-20011003/einfo.c Mon Oct 1 15:42:08 2001
+++ /home/ldoolitt/cvs/mtd/util/einfo.c Tue Apr 10 00:57:45 2001
@@ -20,7 +20,7 @@
}
// Open and size the device
- if ((Fd = open(argv[1],O_RDONLY)) < 0)
+ if ((Fd = open(argv[1],O_RDWR)) < 0)
{
fprintf(stderr,"File open error\n");
return 8;
diff -ur mtd-util-20011003/mtd_debug.c /home/ldoolitt/cvs/mtd/util/mtd_debug.c
--- mtd-util-20011003/mtd_debug.c Mon Oct 1 16:01:41 2001
+++ /home/ldoolitt/cvs/mtd/util/mtd_debug.c Mon Jun 18 03:47:25 2001
@@ -357,7 +357,6 @@
{
const char *progname;
int err = 0,fd,option = OPT_INFO;
- int open_flag;
(progname = strrchr (argv[0],'/')) ? progname++ : (progname = argv[0]);
/* parse command-line options */
@@ -373,8 +372,7 @@
showusage (progname);
/* open device */
- open_flag = (option==OPT_INFO || option==OPT_READ) ? O_RDONLY : O_RDWR;
- if ((fd = open (argv[2],O_SYNC | open_flag)) < 0)
+ if ((fd = open (argv[2],O_SYNC | O_RDWR)) < 0)
{
perror ("open()");
exit (1);
next reply other threads:[~2001-10-05 18:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-05 18:37 Larry Doolittle [this message]
2001-10-08 9:15 ` minor einfo and mtd_debug improvement David Woodhouse
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=20011005113711.A29087@recycle.lbl.gov \
--to=ldoolitt@recycle.lbl.gov \
--cc=linux-mtd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox