[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dd PATCH: add conv=direct
From: |
Jim Meyering |
Subject: |
Re: dd PATCH: add conv=direct |
Date: |
Thu, 08 Apr 2004 13:07:30 +0200 |
Paul Eggert <address@hidden> wrote:
> At the end of this message is a proposed patch to implement everything
> people other than myself have asked for so far, along with several
> other things since I was in the neighborhood.
Thanks for that nice patch!
I've applied it, and made these additional changes:
2004-04-08 Jim Meyering <address@hidden>
* src/dd.c (set_fd_flags): Don't OR in -1 when fcntl fails.
Rename parameter, flags, to avoid shadowing global.
Index: dd.c
===================================================================
RCS file: /fetish/cu/src/dd.c,v
retrieving revision 1.155
diff -u -p -r1.155 dd.c
--- a/dd.c 8 Apr 2004 10:22:05 -0000 1.155
+++ b/dd.c 8 Apr 2004 11:02:20 -0000
@@ -1017,12 +1017,12 @@ copy_with_unblock (char const *buf, size
in FLAGS. The file's name is NAME. */
static void
-set_fd_flags (int fd, int flags, char const *name)
+set_fd_flags (int fd, int add_flags, char const *name)
{
- if (flags)
+ if (add_flags)
{
int old_flags = fcntl (fd, F_GETFL);
- int new_flags = old_flags | flags;
+ int new_flags = old_flags < 0 ? add_flags : (old_flags | add_flags);
if (old_flags < 0
|| (new_flags != old_flags && fcntl (fd, F_SETFL, new_flags) == -1))
error (EXIT_FAILURE, errno, _("setting flags for %s"), quote (name));
- Re: dd PATCH: add conv=direct, (continued)
- Re: dd PATCH: add conv=direct, Andy Isaacson, 2004/04/07
- Re: dd PATCH: add conv=direct, Andrew Morton, 2004/04/07
- Re: dd PATCH: add conv=direct, Andy Isaacson, 2004/04/07
- Re: dd PATCH: add conv=direct, Andrew Morton, 2004/04/07
- Re: dd PATCH: add conv=direct, Andy Isaacson, 2004/04/07
- Re: dd PATCH: add conv=direct, Andrew Morton, 2004/04/07
- Re: dd PATCH: add conv=direct, Andy Isaacson, 2004/04/07
- Re: dd PATCH: add conv=direct, Valdis . Kletnieks, 2004/04/08
- Re: dd PATCH: add conv=direct, Bruce Allen, 2004/04/08
- Re: dd PATCH: add conv=direct, Paul Eggert, 2004/04/08
- Re: dd PATCH: add conv=direct,
Jim Meyering <=
- Re: dd PATCH: add conv=direct, Paul Eggert, 2004/04/08
- Re: dd PATCH: add conv=direct, Paul Jarc, 2004/04/08
- Re: dd PATCH: add conv=direct, Jim Meyering, 2004/04/08
- Re: dd PATCH: add conv=direct, Philippe Troin, 2004/04/08
- dd patch to remove noctty, Paul Eggert, 2004/04/08
- Re: dd patch to remove noctty, Jim Meyering, 2004/04/08
- Message not available
- Re: dd PATCH: add conv=direct, Paul Eggert, 2004/04/19
- Re: dd PATCH: add conv=direct, James Antill, 2004/04/20
- Re: dd PATCH: add conv=direct, Anton Blanchard, 2004/04/10
- Re: dd PATCH: add conv=direct, Wim Coekaerts, 2004/04/10