bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] install: add -C option to install file only when necessary


From: Eric Blake
Subject: Re: [PATCH] install: add -C option to install file only when necessary
Date: Tue, 17 Feb 2009 14:59:43 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jim Meyering <jim <at> meyering.net> writes:

> 
> Kamil Dudka <kdudka <at> redhat.com> wrote:
> > Seems better. Thanks!
> 
> I've applied that and pushed it.

OK for this followup, necessary on cygwin and a no-op for most other 
platforms?  Also, some of the files created by the patch are listed as 
copyright 2008 (when they were first started), rather than 2009 (when they were 
published).


From: Eric Blake <address@hidden>
Date: Tue, 17 Feb 2009 07:58:39 -0700
Subject: [PATCH] install: compare files in binary mode

* src/install.c (need_copy): Use O_BINARY when it matters.
---
 src/install.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/install.c b/src/install.c
index 669fbea..2aa27d0 100644
--- a/src/install.c
+++ b/src/install.c
@@ -1,5 +1,5 @@
 /* install - copy files and set attributes
-   Copyright (C) 89, 90, 91, 1995-2008 Free Software Foundation, Inc.
+   Copyright (C) 89, 90, 91, 1995-2009 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -255,11 +255,11 @@ need_copy (const char *src_name, const char
     }

   /* compare files content */
-  src_fd = open (src_name, O_RDONLY);
+  src_fd = open (src_name, O_RDONLY | O_BINARY);
   if (src_fd < 0)
     return true;

-  dest_fd = open (dest_name, O_RDONLY);
+  dest_fd = open (dest_name, O_RDONLY | O_BINARY);
   if (dest_fd < 0)
     {
       close (src_fd);
-- 
1.6.1.2








reply via email to

[Prev in Thread] Current Thread [Next in Thread]