version 1.61, 2015/07/18 15:42:37 |
version 1.62, 2015/07/19 18:27:26 |
|
|
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 *); |
|
|
|
|
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 */ |
} |
} |
|
|
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); |
|
|
* 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; |