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

Diff for /src/usr.bin/xinstall/xinstall.c between version 1.63 and 1.64

version 1.63, 2015/12/31 16:16:54 version 1.64, 2016/05/12 21:43:27
Line 56 
Line 56 
   
 #define DIRECTORY       0x01            /* Tell install it's a directory. */  #define DIRECTORY       0x01            /* Tell install it's a directory. */
 #define SETFLAGS        0x02            /* Tell install to set flags. */  #define SETFLAGS        0x02            /* Tell install to set flags. */
   #define USEFSYNC        0x04            /* Tell install to use fsync(2). */
 #define NOCHANGEBITS    (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND)  #define NOCHANGEBITS    (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND)
 #define BACKUP_SUFFIX   ".old"  #define BACKUP_SUFFIX   ".old"
   
Line 90 
Line 91 
         char *flags, *to_name, *group = NULL, *owner = NULL;          char *flags, *to_name, *group = NULL, *owner = NULL;
   
         iflags = 0;          iflags = 0;
         while ((ch = getopt(argc, argv, "B:bCcDdf:g:m:o:pSs")) != -1)          while ((ch = getopt(argc, argv, "B:bCcDdFf:g:m:o:pSs")) != -1)
                 switch(ch) {                  switch(ch) {
                 case 'C':                  case 'C':
                         docompare = 1;                          docompare = 1;
Line 104 
Line 105 
                 case 'c':                  case 'c':
                         /* For backwards compatibility. */                          /* For backwards compatibility. */
                         break;                          break;
                   case 'F':
                           iflags |= USEFSYNC;
                           break;
                 case 'f':                  case 'f':
                         flags = optarg;                          flags = optarg;
                         if (strtofflags(&flags, &fset, NULL))                          if (strtofflags(&flags, &fset, NULL))
Line 377 
Line 381 
                             safecopy ? tempfile :to_name, strerror(errno));                              safecopy ? tempfile :to_name, strerror(errno));
         }          }
   
           if (flags & USEFSYNC)
                   fsync(to_fd);
         (void)close(to_fd);          (void)close(to_fd);
         if (!devnull)          if (!devnull)
                 (void)close(from_fd);                  (void)close(from_fd);
Line 618 
Line 624 
 usage(void)  usage(void)
 {  {
         (void)fprintf(stderr, "\          (void)fprintf(stderr, "\
 usage: install [-bCcDdpSs] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner]\n            source ... target ...\n");  usage: install [-bCcDdDpSs] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner]\n           source ... target ...\n");
         exit(1);          exit(1);
         /* NOTREACHED */          /* NOTREACHED */
 }  }

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.64