create.c (2877) | create.c (6286) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 32 unchanged lines hidden (view full) --- 41#include <fcntl.h> 42#include <fts.h> 43#include <dirent.h> 44#include <grp.h> 45#include <pwd.h> 46#include <errno.h> 47#include <unistd.h> 48#include <stdio.h> | 1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 32 unchanged lines hidden (view full) --- 41#include <fcntl.h> 42#include <fts.h> 43#include <dirent.h> 44#include <grp.h> 45#include <pwd.h> 46#include <errno.h> 47#include <unistd.h> 48#include <stdio.h> |
49#include <md5.h> |
|
49#include "mtree.h" 50#include "extern.h" 51 52#define INDENTNAMELEN 15 53#define MAXLINELEN 80 54 55extern long int crc_total; 56extern int ftsoptions; --- 125 unchanged lines hidden (view full) --- 182 p->fts_statp->st_mtimespec.ts_nsec); 183 if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { 184 if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 || 185 crc(fd, &val, &len)) 186 err("%s: %s", p->fts_accpath, strerror(errno)); 187 (void)close(fd); 188 output(indent, &offset, "cksum=%lu", val); 189 } | 50#include "mtree.h" 51#include "extern.h" 52 53#define INDENTNAMELEN 15 54#define MAXLINELEN 80 55 56extern long int crc_total; 57extern int ftsoptions; --- 125 unchanged lines hidden (view full) --- 183 p->fts_statp->st_mtimespec.ts_nsec); 184 if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) { 185 if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 || 186 crc(fd, &val, &len)) 187 err("%s: %s", p->fts_accpath, strerror(errno)); 188 (void)close(fd); 189 output(indent, &offset, "cksum=%lu", val); 190 } |
191 if (keys & F_MD5 && S_ISREG(p->fts_statp->st_mode)) { 192 char *md5digest = MD5File(p->fts_accpath); 193 194 if (!md5digest) { 195 err("%s: %s", p->fts_accpath, strerror(errno)); 196 } else { 197 output(indent, &offset, "md5digest=%s", md5digest); 198 free(md5digest); 199 } 200 } |
|
190 if (keys & F_SLINK && 191 (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) 192 output(indent, &offset, "link=%s", rlink(p->fts_accpath)); 193 (void)putchar('\n'); 194} 195 196#define MAXGID 5000 197#define MAXUID 5000 --- 136 unchanged lines hidden --- | 201 if (keys & F_SLINK && 202 (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) 203 output(indent, &offset, "link=%s", rlink(p->fts_accpath)); 204 (void)putchar('\n'); 205} 206 207#define MAXGID 5000 208#define MAXUID 5000 --- 136 unchanged lines hidden --- |