version 1.63, 2015/12/31 16:16:54 |
version 1.64, 2016/05/12 21:43:27 |
|
|
|
|
#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" |
|
|
|
|
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; |
|
|
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)) |
|
|
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); |
|
|
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 */ |
} |
} |