Lines Matching defs:arcn

75 file_creat(ARCHD *arcn)
92 file_mode = arcn->sb.st_mode & FILEBITS;
93 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
102 if (unlnk_exist(arcn->name, arcn->type) != 0)
111 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC,
115 if (nodirs || chk_path(arcn->name,arcn->sb.st_uid,arcn->sb.st_gid) < 0) {
116 syswarn(1, oerrno, "Unable to create %s", arcn->name);
132 file_close(ARCHD *arcn, int fd)
140 arcn->name);
148 res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid);
156 arcn->sb.st_mode &= ~(SETBITS);
158 set_pmode(arcn->name, arcn->sb.st_mode);
160 set_ftime(arcn->name, arcn->sb.st_mtime, arcn->sb.st_atime, 0);
165 * Create a hard link to arcn->ln_name from arcn->name. arcn->ln_name
172 lnk_creat(ARCHD *arcn)
180 if (lstat(arcn->ln_name, &sb) < 0) {
181 syswarn(1,errno,"Unable to link to %s from %s", arcn->ln_name,
182 arcn->name);
188 arcn->ln_name);
192 return(mk_link(arcn->ln_name, &sb, arcn->name, 0));
197 * Create a hard link to arcn->org_name from arcn->name. Only used in copy
206 cross_lnk(ARCHD *arcn)
213 if (arcn->type == PAX_DIR)
215 return(mk_link(arcn->org_name, &(arcn->sb), arcn->name, 1));
230 chk_same(ARCHD *arcn)
238 if (lstat(arcn->name, &sb) < 0)
246 if ((arcn->sb.st_dev == sb.st_dev) && (arcn->sb.st_ino == sb.st_ino)) {
248 arcn->name);
340 node_creat(ARCHD *arcn)
355 file_mode = arcn->sb.st_mode & FILEBITS;
358 switch(arcn->type) {
360 res = mkdir(arcn->name, file_mode);
366 res = mknod(arcn->name, file_mode, arcn->sb.st_rdev);
370 res = mknod(arcn->name, file_mode, arcn->sb.st_rdev);
373 res = mkfifo(arcn->name, file_mode);
381 arcn->name);
384 res = symlink(arcn->ln_name, arcn->name);
395 arcn->name);
411 if ((ign = unlnk_exist(arcn->name, arcn->type)) < 0)
417 if (nodirs || chk_path(arcn->name,arcn->sb.st_uid,arcn->sb.st_gid) < 0) {
418 syswarn(1, oerrno, "Could not create: %s", arcn->name);
427 res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid);
437 arcn->sb.st_mode &= ~(SETBITS);
439 set_pmode(arcn->name, arcn->sb.st_mode);
441 if (arcn->type == PAX_DIR && strcmp(NM_CPIO, argv0) != 0) {
451 if (access(arcn->name, R_OK | W_OK | X_OK) < 0) {
452 if (lstat(arcn->name, &sb) < 0) {
454 arcn->name);
455 set_pmode(arcn->name,file_mode | S_IRWXU);
463 set_pmode(arcn->name,
466 arcn->sb.st_mode = sb.st_mode;
473 add_dir(arcn->name, arcn->nlen, &(arcn->sb), 1);
475 add_dir(arcn->name, arcn->nlen, &(arcn->sb), 0);
479 set_ftime(arcn->name, arcn->sb.st_mtime, arcn->sb.st_atime, 0);
856 * reset access time (tflag) do so (the times are stored in arcn).
860 rdfile_close(ARCHD *arcn, int *fd)
876 set_ftime(arcn->org_name, arcn->sb.st_mtime, arcn->sb.st_atime, 1);
890 set_crc(ARCHD *arcn, int fd)
904 arcn->crc = 0L;
908 if ((size = (u_long)arcn->sb.st_blksize) > (u_long)sizeof(tbuf))
927 if (cpcnt != arcn->sb.st_size)
928 paxwarn(1, "File changed size %s", arcn->org_name);
930 syswarn(1, errno, "Failed stat on %s", arcn->org_name);
931 else if (arcn->sb.st_mtime != sb.st_mtime)
932 paxwarn(1, "File %s was modified during read", arcn->org_name);
934 syswarn(1, errno, "File rewind failed on: %s", arcn->org_name);
936 arcn->crc = crc;