[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.61 and 1.62

version 1.61, 2015/07/18 15:42:37 version 1.62, 2015/07/19 18:27:26
Line 72 
Line 72 
 void    copy(int, char *, int, char *, off_t, int);  void    copy(int, char *, int, char *, off_t, int);
 int     compare(int, const char *, off_t, int, const char *, off_t);  int     compare(int, const char *, off_t, int, const char *, off_t);
 void    install(char *, char *, u_long, u_int);  void    install(char *, char *, u_long, u_int);
 void    install_dir(char *);  void    install_dir(char *, int);
 void    strip(char *);  void    strip(char *);
 void    usage(void);  void    usage(void);
 int     create_newfile(char *, struct stat *);  int     create_newfile(char *, struct stat *);
Line 167 
Line 167 
   
         if (dodir) {          if (dodir) {
                 for (; *argv != NULL; ++argv)                  for (; *argv != NULL; ++argv)
                         install_dir(*argv);                          install_dir(*argv, mode);
                 exit(EX_OK);                  exit(EX_OK);
                 /* NOTREACHED */                  /* NOTREACHED */
         }          }
Line 176 
Line 176 
                 char *dest = dirname(argv[argc - 1]);                  char *dest = dirname(argv[argc - 1]);
                 if (dest == NULL)                  if (dest == NULL)
                         errx(EX_OSERR, "cannot determine dirname");                          errx(EX_OSERR, "cannot determine dirname");
                 install_dir(dest);                  /*
                    * When -D is passed, do not chmod the directory with the mode set for
                    * the target file. If more restrictive permissions are required then
                    * '-d -m' ought to be used instead.
                    */
                   install_dir(dest, 0755);
         }          }
   
         no_target = stat(to_name = argv[argc - 1], &to_sb);          no_target = stat(to_name = argv[argc - 1], &to_sb);
Line 572 
Line 577 
  *      build directory hierarchy   *      build directory hierarchy
  */   */
 void  void
 install_dir(char *path)  install_dir(char *path, int mode)
 {  {
         char *p;          char *p;
         struct stat sb;          struct stat sb;

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.62