[BACK]Return to util.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / gzsig

Diff for /src/usr.bin/gzsig/Attic/util.c between version 1.2 and 1.3

version 1.2, 2005/05/28 08:07:45 version 1.3, 2013/03/10 10:34:33
Line 46 
Line 46 
 #include "util.h"  #include "util.h"
   
 int  int
 copy_permissions(char *srcfile, char *dstfile)  copy_permissions(int srcfd, int dstfd)
 {  {
         struct stat st;          struct stat st;
   
         if (stat(srcfile, &st) < 0)          if (fstat(srcfd, &st) < 0)
                 return (-1);                  return (-1);
   
         if (chmod(dstfile, st.st_mode) < 0)          if (fchown(dstfd, st.st_uid, st.st_gid) < 0)
                 return (-1);                  return (-1);
   
         if (chown(dstfile, st.st_uid, st.st_gid) < 0)          if (fchmod(dstfd, st.st_mode) < 0)
                 return (-1);                  return (-1);
   
         return (0);          return (0);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3