From: "Steve Schmidtke" <steve_schmidtke@hotmail.com>
To: jdike@addtoit.com
Cc: User-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] cleanup file io
Date: Thu, 04 Sep 2003 05:11:11 +0000 [thread overview]
Message-ID: <BAY7-F82eujjeHdzXT60000f1c9@hotmail.com> (raw)
Hi Jeff,
Can I submit a cleanup patch that does stuff like this all over UML:
int load_initrd(char *filename, void *buf, int size)
{
int fd, n;
if((fd = os_open_file(filename, of_read(OPENFLAGS()), 0)) < 0){
- printk("Opening '%s' failed - errno = %d\n", filename,
errno);
+ printk("Opening '%s' failed - err = %d\n", filename, fd);
return(-1);
}
- if((n = read(fd, buf, size)) != size){
+ if((n = os_read_file(fd, buf, size)) != size){
printk("Read of %d bytes from '%s' returned %d, errno =
%d\n",
size, filename, n, errno);
return(-1);
}
return(0);
}
i.e. wrap bare file functions into their os_* counterparts, and remove
unnecessary references to errno?
Also, is there a style reason some functions like the one above return -1
rather than -errno or the failed (negative) return value from the os_*
functions? I'd like to standardize one style or the other while I'm at it,
if that's workable.
Thanks,
Steve Schmidtke
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next reply other threads:[~2003-09-04 5:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-04 5:11 Steve Schmidtke [this message]
2003-09-05 19:00 ` [uml-devel] Re: cleanup file io Jeff Dike
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=BAY7-F82eujjeHdzXT60000f1c9@hotmail.com \
--to=steve_schmidtke@hotmail.com \
--cc=User-mode-linux-devel@lists.sourceforge.net \
--cc=jdike@addtoit.com \
/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