Lines Matching refs:s
42 static void fix_stat(const char *path, struct stat *s) in fix_stat() argument
56 s->st_uid = p->uid; in fix_stat()
57 s->st_gid = p->gid; in fix_stat()
58 s->st_mode = p->mode | (s->st_mode & ~07777); in fix_stat()
62 s->st_uid = empty_path_config->uid; in fix_stat()
63 s->st_gid = empty_path_config->gid; in fix_stat()
64 s->st_mode = empty_path_config->mode | (s->st_mode & ~07777); in fix_stat()
67 unsigned st_mode = s->st_mode; in fix_stat()
68 int is_dir = S_ISDIR(s->st_mode) || strcmp(path, TRAILER) == 0; in fix_stat()
69 fs_config(path, is_dir, target_out_path, &s->st_uid, &s->st_gid, &st_mode, &capabilities); in fix_stat()
70 s->st_mode = (typeof(s->st_mode)) st_mode; in fix_stat()
73 if (S_ISREG(s->st_mode) || S_ISDIR(s->st_mode) || S_ISLNK(s->st_mode)) { in fix_stat()
74 s->st_rdev = 0; in fix_stat()
78 static void _eject(struct stat *s, char *out, int olen, char *data, unsigned datasize) in _eject() argument
90 fix_stat(out, s); in _eject()
97 s->st_mode, in _eject()
105 major(s->st_rdev), in _eject()
106 minor(s->st_rdev), in _eject()
130 struct stat s; in _eject_trailer() local
131 memset(&s, 0, sizeof(s)); in _eject_trailer()
132 _eject(&s, TRAILER, 10, 0, 0); in _eject_trailer()
210 struct stat s; in _archive() local
211 if(lstat(in, &s)) err(1, "could not stat '%s'", in); in _archive()
213 if(S_ISREG(s.st_mode)){ in _archive()
217 char* tmp = (char*) malloc(s.st_size); in _archive()
218 if(tmp == 0) errx(1, "cannot allocate %zd bytes", s.st_size); in _archive()
220 if(read(fd, tmp, s.st_size) != s.st_size) { in _archive()
221 err(1, "cannot read %zd bytes", s.st_size); in _archive()
224 _eject(&s, out, olen, tmp, s.st_size); in _archive()
228 } else if(S_ISDIR(s.st_mode)) { in _archive()
229 _eject(&s, out, olen, 0, 0); in _archive()
231 } else if(S_ISLNK(s.st_mode)) { in _archive()
236 _eject(&s, out, olen, buf, size); in _archive()
237 } else if(S_ISBLK(s.st_mode) || S_ISCHR(s.st_mode) || in _archive()
238 S_ISFIFO(s.st_mode) || S_ISSOCK(s.st_mode)) { in _archive()
239 _eject(&s, out, olen, NULL, 0); in _archive()
241 errx(1, "Unknown '%s' (mode %d)?", in, s.st_mode); in _archive()
310 struct stat s; in append_devnodes_desc_dir() local
312 if (sscanf(args, "%o %d %d", &s.st_mode, &s.st_uid, &s.st_gid) != 3) return -1; in append_devnodes_desc_dir()
314 s.st_mode |= S_IFDIR; in append_devnodes_desc_dir()
316 _eject(&s, path, strlen(path), NULL, 0); in append_devnodes_desc_dir()
324 struct stat s; in append_devnodes_desc_nod() local
327 if (sscanf(args, "%o %d %d %c %d %d", &s.st_mode, &s.st_uid, &s.st_gid, in append_devnodes_desc_nod()
330 s.st_rdev = MKDEV(major, minor); in append_devnodes_desc_nod()
333 s.st_mode |= S_IFBLK; in append_devnodes_desc_nod()
336 s.st_mode |= S_IFCHR; in append_devnodes_desc_nod()
342 _eject(&s, path, strlen(path), NULL, 0); in append_devnodes_desc_nod()