Lines Matching defs:st
105 static struct inode_list *seen_inode(void **list, struct stat *st, char *name)
107 if (!st) llist_traverse(*list, llist_free_arg);
108 else if (!S_ISDIR(st->st_mode) && st->st_nlink > 1) {
112 if(new->ino == st->st_ino && new->dev == st->st_dev)
116 new->ino = st->st_ino;
117 new->dev = st->st_dev;
161 static void add_file(struct archive_handler *tar, char **nam, struct stat *st)
176 if (S_ISDIR(st->st_mode) && name[strlen(name)-1] != '/') {
194 itoo(hdr.mode, sizeof(hdr.mode), st->st_mode &07777);
195 itoo(hdr.uid, sizeof(hdr.uid), st->st_uid);
196 itoo(hdr.gid, sizeof(hdr.gid), st->st_gid);
198 itoo(hdr.mtime, sizeof(hdr.mtime), st->st_mtime);
201 if ((node = seen_inode(&TT.inodes, st, hname))) {
207 } else if (S_ISREG(st->st_mode)) {
209 if (st->st_size <= (off_t)0777777777777LL)
210 itoo(hdr.size, sizeof(hdr.size), st->st_size);
213 hname, (unsigned long long)st->st_size);
216 } else if (S_ISLNK(st->st_mode)) {
227 else if (S_ISDIR(st->st_mode)) hdr.type = '5';
228 else if (S_ISFIFO(st->st_mode)) hdr.type = '6';
229 else if (S_ISBLK(st->st_mode) || S_ISCHR(st->st_mode)) {
230 hdr.type = (S_ISCHR(st->st_mode))?'3':'4';
231 itoo(hdr.major, sizeof(hdr.major), major(st->st_rdev));
232 itoo(hdr.minor, sizeof(hdr.minor), minor(st->st_rdev));
234 error_msg("unknown file type '%o'", st->st_mode & S_IFMT);
240 if ((pw = getpwuid(st->st_uid)))
242 else snprintf(hdr.uname, sizeof(hdr.uname), "%d", st->st_uid);
244 if ((gr = getgrgid(st->st_gid)))
246 else snprintf(hdr.gname, sizeof(hdr.gname), "%d", st->st_gid);
260 copy_in_out(fd, tar->src_fd, st->st_size);
261 if (st->st_size%512) writeall(tar->src_fd, buf, (512-(st->st_size%512)));
267 struct stat st;
271 if (!fstat(hdl->src_fd, &st) && st.st_dev == node->st.st_dev
272 && st.st_ino == node->st.st_ino) {
279 add_file(hdl, &path, &(node->st)); //path may be modified