Lines Matching defs:target

47 char	target[RDIST_BUFSIZ];	/* target/source directory name */
48 char *tp; /* pointer to end of target name */
50 int catname; /* cat name to target name */
113 case 'T': /* init target file/directory name */
114 catname = 1; /* target should be directory */
117 case 't': /* init target file/directory name */
120 if (exptilde(target, sizeof (target), cp) == NULL)
122 tp = target;
255 rname = exptilde(target, sizeof (target), src);
258 tp = target;
271 rname = rindex(target, '/');
273 rname = target;
278 printf("target = %s, rname = %s\n", target, rname);
309 * Transfer the file or directory in target[].
330 if (except(target))
332 if ((opts & FOLLOW ? stat(target, &stb) : lstat(target, &stb)) < 0) {
333 error("%s: %s\n", target, strerror(errno));
350 target, stb.st_uid);
357 target, stb.st_gid);
363 log(lfp, "need to install: %s\n", target);
366 log(lfp, "installing: %s\n", target);
372 if ((d = opendir(target)) == NULL) {
373 error("%s: %s\n", target, strerror(errno));
395 len = tp - target;
402 error("%.*s/%s: Name too long\n", len, target,
429 if (*lp->target == 0)
435 "k%o %s/%s %s\n", opts, lp->target,
456 sizerr = (readlink(target, buf, RDIST_BUFSIZ) != stb.st_size);
466 error("%s: not a file or directory\n", target);
472 log(lfp, "need to update: %s\n", target);
475 log(lfp, "updating: %s\n", target);
483 if (*lp->target == 0)
488 "k%o %s/%s %s\n", opts, lp->target,
502 if ((f = open(target, 0)) < 0) {
503 error("%s: %s\n", target, strerror(errno));
531 error("%s: file changed size\n", target);
543 if (sc->sc_args != NULL && !inlist(sc->sc_args, target))
548 (void) snprintf(buf, sizeof (buf), "SFILE=%s;%s\n", target,
581 opts & WHOLE ? target : strsub(source, destination, target),
583 error("%s: target name too long\n", target);
587 if (strlcpy(lp->target, Tdest,
588 sizeof (lp->target)) >= sizeof (lp->target))
589 error("%s: target name too long\n", Tdest);
591 *lp->target = 0;
717 log(lfp, "Warning: %s: remote copy is newer\n", target);
739 if (sizeof (target) - (tp - target) >= strlen(name) + 2) {
742 error("%.*s/%s: Name too long\n", tp - target,
743 target, name);
748 if (lstat(target, &stb) < 0) {
752 error("%s:%s: %s\n", host, target, strerror(errno));
845 host, target);
859 if (lstat(target, &stb) == 0) {
866 "local mode %o", target,
871 } else if (errno == ENOENT && (mkdir(target, mode) == 0 ||
872 chkparent(target) == 0 &&
873 (isdot == 1 || mkdir(target, mode) == 0))) {
874 if (chog(target, owner, group, mode) == 0)
878 error("%s:%s: %s\n", host, target, strerror(errno));
885 if (sizeof (target) - (tp - target) >= strlen(cp) + 2) {
888 error("%.*s/%s: Name too long\n", tp - target,
889 target, cp);
893 cp = rindex(target, '/');
896 else if (cp == target)
902 * sizeof (target) = RDIST_BUFSIZ and sizeof (tmpname) = 11
906 (void) snprintf(new, sizeof (new), "%s/%s", target, tmpname);
934 if ((i = readlink(target, tbuf, MAXPATHLEN)) >= 0 &&
994 if ((f1 = fopen(target, "r")) == NULL)
1015 sendrem("need to update: %s", target);
1026 tvp[0].tv_sec = stb.st_atime; /* old atime from target */
1038 if (rename(new, target) < 0) {
1040 error("%s:%s: %s\n", host, target, strerror(errno));
1045 sendrem("updated %s", target);
1081 if (sizeof (target) - (tp - target) >= strlen(cp) + 2) {
1084 error("%.*s/%s: Name too long\n", tp - target,
1085 target, cp);
1089 if (lstat(target, &stb) == 0) {
1092 error("%s:%s: not a regular file\n", host, target);
1097 if (chkparent(target) < 0) {
1099 host, target, strerror(errno));
1112 sendrem("need to update: %s", target);
1116 if (exists && (unlink(target) < 0)) {
1118 host, target, strerror(errno));
1123 if (link(oldname, target) < 0) {
1125 host, target, oldname);
1267 printf("check %s\n", target);
1268 if (except(target))
1270 else if (lstat(target, &stb) < 0)
1330 if ((d = opendir(target)) == NULL) {
1331 error("%s:%s: %s\n", host, target, strerror(errno));
1337 len = tp - target;
1345 host, target, dp->d_name);
1354 if (lstat(target, &stb) < 0) {
1355 error("%s:%s: %s\n", host, target, strerror(errno));
1370 sendrem("need to remove: %s", target);
1399 if (unlink(target) < 0)
1407 error("%s:%s: not a plain file\n", host, target);
1411 if ((d = opendir(target)) == NULL)
1415 len = tp - target;
1423 host, target, dp->d_name);
1432 if (lstat(target, &stb) < 0) {
1433 error("%s:%s: %s\n", host, target, strerror(errno));
1441 if (rmdir(target) < 0) {
1443 error("%s:%s: %s\n", host, target, strerror(errno));
1447 sendrem("removed %s", target);