cvs commit: patches/sed sed-4.1-perms-1.patch

jim at linuxfromscratch.org jim at linuxfromscratch.org
Wed Jun 16 11:26:00 PDT 2004


jim         04/06/16 12:26:00

  Added:       sed      sed-4.1-perms-1.patch
  Log:
  Added: sed-4.1-perms-1.patch
  
  Revision  Changes    Path
  1.1                  patches/sed/sed-4.1-perms-1.patch
  
  Index: sed-4.1-perms-1.patch
  ===================================================================
  Submitted By: Jürg Billeter <j at bitron.ch>
  Date: 2004-06-16
  Initial Package Version: 4.1
  Upstream Status: submitted
  Origin: Jürg Billeter
  Description: chmod and chown the output file if working in-place
  
  diff -uNr sed-4.1.orig/sed/execute.c sed-4.1/sed/execute.c
  --- sed-4.1.orig/sed/execute.c	2004-03-13 10:30:39.000000000 +0100
  +++ sed-4.1/sed/execute.c	2004-06-16 17:57:22.693586941 +0200
  @@ -656,7 +656,6 @@
   
     if (in_place_extension)
       {
  -      int output_fd;
         char *tmpdir = ck_strdup(name), *p;
         struct stat st;
   
  @@ -672,11 +671,11 @@
   
         fstat (fileno (input->fp), &st);
   #ifdef HAVE_FCHMOD
  -      fchmod (output_fd, st.st_mode);
  +      fchmod (fileno (output_file.fp), st.st_mode);
   #endif
   #ifdef HAVE_FCHOWN
  -      if (fchown (output_fd, st.st_uid, st.st_gid) == -1)
  -        fchown (output_fd, -1, st.st_gid);
  +      if (fchown (fileno (output_file.fp), st.st_uid, st.st_gid) == -1)
  +        fchown (fileno (output_file.fp), -1, st.st_gid);
   #endif
   
         output_file.missing_newline = false;
  
  
  



More information about the patches mailing list