Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261615AbUDHLHG (ORCPT ); Thu, 8 Apr 2004 07:07:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261672AbUDHLHG (ORCPT ); Thu, 8 Apr 2004 07:07:06 -0400 Received: from meyering.net1.nerim.net ([62.212.115.149]:54519 "EHLO elf.meyering.net") by vger.kernel.org with ESMTP id S261615AbUDHLHD (ORCPT ); Thu, 8 Apr 2004 07:07:03 -0400 To: Paul Eggert Cc: bug-coreutils@gnu.org, Andrew Morton , Bruce Allen , linux-kernel@vger.kernel.org, Andy Isaacson Subject: Re: dd PATCH: add conv=direct In-Reply-To: <87r7uzlzz7.fsf@penguin.cs.ucla.edu> (Paul Eggert's message of "Wed, 07 Apr 2004 23:56:28 -0700") References: <87r7uzlzz7.fsf@penguin.cs.ucla.edu> From: Jim Meyering Date: Thu, 08 Apr 2004 13:07:30 +0200 Message-ID: <85k70qsp71.fsf@pi.meyering.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1567 Lines: 38 Paul Eggert 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 * 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)); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/