Whitespace cleanup pass; reduce diffs with OpenBSD. No functional changes.
This commit is contained in:
parent
19476d5cac
commit
d12dd1a1b5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76019
@ -78,7 +78,7 @@ static struct stat arsb; /* stat of archive device at open */
|
||||
static int invld_rec; /* tape has out of spec record size */
|
||||
static int wr_trail = 1; /* trailer was rewritten in append */
|
||||
static int can_unlnk = 0; /* do we unlink null archives? */
|
||||
char *arcname; /* printable name of archive */
|
||||
char *arcname; /* printable name of archive */
|
||||
|
||||
static int get_phys __P((void));
|
||||
extern sigset_t s_mask;
|
||||
@ -101,7 +101,7 @@ ar_open(name)
|
||||
char *name;
|
||||
#endif
|
||||
{
|
||||
struct mtget mb;
|
||||
struct mtget mb;
|
||||
|
||||
if (arfd != -1)
|
||||
(void)close(arfd);
|
||||
@ -389,11 +389,11 @@ ar_close()
|
||||
|
||||
(void)fprintf(outf,
|
||||
# ifdef NET2_STAT
|
||||
"%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
|
||||
"%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
|
||||
# else
|
||||
"%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n",
|
||||
"%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n",
|
||||
# endif
|
||||
argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt);
|
||||
argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt);
|
||||
(void)fflush(outf);
|
||||
flcnt = 0;
|
||||
}
|
||||
@ -740,7 +740,7 @@ ar_rdsync()
|
||||
long fsbz;
|
||||
off_t cpos;
|
||||
off_t mpos;
|
||||
struct mtop mb;
|
||||
struct mtop mb;
|
||||
|
||||
/*
|
||||
* Fail resync attempts at user request (done) or this is going to be
|
||||
@ -896,7 +896,7 @@ ar_rev(sksz)
|
||||
#endif
|
||||
{
|
||||
off_t cpos;
|
||||
struct mtop mb;
|
||||
struct mtop mb;
|
||||
register int phyblk;
|
||||
|
||||
/*
|
||||
@ -1256,10 +1256,10 @@ ar_next()
|
||||
tty_prnt("Empty file name, try again\n");
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(buf, "..")) {
|
||||
tty_prnt("Illegal file name: .. try again\n");
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(buf, "..")) {
|
||||
tty_prnt("Illegal file name: .. try again\n");
|
||||
continue;
|
||||
}
|
||||
if (strlen(buf) > PAXPATHLEN) {
|
||||
tty_prnt("File name too long, try again\n");
|
||||
continue;
|
||||
|
@ -66,7 +66,7 @@ extern sigset_t s_mask;
|
||||
* the user: list, append, read ...
|
||||
*/
|
||||
|
||||
static char hdbuf[BLKMULT]; /* space for archive header on read */
|
||||
static char hdbuf[BLKMULT]; /* space for archive header on read */
|
||||
u_long flcnt; /* number of files processed */
|
||||
|
||||
/*
|
||||
@ -1016,7 +1016,7 @@ next_head(arcn)
|
||||
if (!in_resync) {
|
||||
if (act == APPND) {
|
||||
paxwarn(1,
|
||||
"Archive I/O error, cannot continue");
|
||||
"Archive I/O error, cannot continue");
|
||||
return(-1);
|
||||
}
|
||||
paxwarn(1,"Archive I/O error. Trying to recover.");
|
||||
|
@ -57,7 +57,7 @@ static const char rcsid[] =
|
||||
*/
|
||||
|
||||
#define MINFBSZ 512 /* default block size for hole detect */
|
||||
#define MAXFLT 10 /* default media read error limit */
|
||||
#define MAXFLT 10 /* default media read error limit */
|
||||
|
||||
/*
|
||||
* Need to change bufmem to dynamic allocation when the upper
|
||||
@ -68,8 +68,8 @@ static char bufmem[MAXBLK+BLKMULT]; /* i/o buffer + pushback id space */
|
||||
static char *buf; /* normal start of i/o buffer */
|
||||
static char *bufend; /* end or last char in i/o buffer */
|
||||
static char *bufpt; /* read/write point in i/o buffer */
|
||||
int blksz = MAXBLK; /* block input/output size in bytes */
|
||||
int wrblksz; /* user spec output size in bytes */
|
||||
int blksz = MAXBLK; /* block input/output size in bytes */
|
||||
int wrblksz; /* user spec output size in bytes */
|
||||
int maxflt = MAXFLT; /* MAX consecutive media errors */
|
||||
int rdblksz; /* first read blksize (tapes only) */
|
||||
off_t wrlimit; /* # of bytes written per archive vol */
|
||||
@ -311,7 +311,7 @@ appnd_start(skcnt)
|
||||
paxwarn(1, "Unable to rewrite archive trailer, cannot append.");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* rd_sync()
|
||||
* A read error occurred on this archive volume. Resync the buffer and
|
||||
@ -756,11 +756,11 @@ rd_wrfile(arcn, ofd, left)
|
||||
* pass the blocksize of the file being written to the write routine,
|
||||
* if the size is zero, use the default MINFBSZ
|
||||
*/
|
||||
if (fstat(ofd, &sb) == 0) {
|
||||
if (fstat(ofd, &sb) == 0) {
|
||||
if (sb.st_blksize > 0)
|
||||
sz = (int)sb.st_blksize;
|
||||
} else
|
||||
syswarn(0,errno,"Unable to obtain block size for file %s",fnm);
|
||||
} else
|
||||
syswarn(0,errno,"Unable to obtain block size for file %s",fnm);
|
||||
rem = sz;
|
||||
*left = 0L;
|
||||
|
||||
@ -859,11 +859,11 @@ cp_file(arcn, fd1, fd2)
|
||||
* pass the blocksize of the file being written to the write routine,
|
||||
* if the size is zero, use the default MINFBSZ
|
||||
*/
|
||||
if (fstat(fd2, &sb) == 0) {
|
||||
if (fstat(fd2, &sb) == 0) {
|
||||
if (sb.st_blksize > 0)
|
||||
sz = sb.st_blksize;
|
||||
} else
|
||||
syswarn(0,errno,"Unable to obtain block size for file %s",fnm);
|
||||
} else
|
||||
syswarn(0,errno,"Unable to obtain block size for file %s",fnm);
|
||||
rem = sz;
|
||||
|
||||
/*
|
||||
|
@ -509,7 +509,7 @@ cpio_wr(arcn)
|
||||
*/
|
||||
if (ul_asc((u_long)MAGIC, hd->c_magic, sizeof(hd->c_magic), OCT) ||
|
||||
ul_asc((u_long)arcn->sb.st_dev, hd->c_dev, sizeof(hd->c_dev),
|
||||
OCT) ||
|
||||
OCT) ||
|
||||
ul_asc((u_long)arcn->sb.st_ino, hd->c_ino, sizeof(hd->c_ino),
|
||||
OCT) ||
|
||||
ul_asc((u_long)arcn->sb.st_mode, hd->c_mode, sizeof(hd->c_mode),
|
||||
|
@ -187,7 +187,7 @@ pax_options(argc, argv)
|
||||
unsigned int flg = 0;
|
||||
unsigned int bflg = 0;
|
||||
register char *pt;
|
||||
FSUB tmp;
|
||||
FSUB tmp;
|
||||
|
||||
/*
|
||||
* process option flags
|
||||
@ -840,11 +840,11 @@ c_frmt(const void *a, const void *b)
|
||||
#else
|
||||
static int
|
||||
c_frmt(a, b)
|
||||
void *a;
|
||||
void *b;
|
||||
void *a;
|
||||
void *b;
|
||||
#endif
|
||||
{
|
||||
return(strcmp(((FSUB *)a)->name, ((FSUB *)b)->name));
|
||||
return(strcmp(((FSUB *)a)->name, ((FSUB *)b)->name));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1077,27 +1077,27 @@ pax_usage()
|
||||
{
|
||||
(void)fputs("usage: pax [-cdnv] [-E limit] [-f archive] ", stderr);
|
||||
(void)fputs("[-s replstr] ... [-U user] ...", stderr);
|
||||
(void)fputs("\n [-G group] ... ", stderr);
|
||||
(void)fputs("\n [-G group] ... ", stderr);
|
||||
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
|
||||
(void)fputs("[pattern ...]\n", stderr);
|
||||
(void)fputs(" pax -r [-cdiknuvDYZ] [-E limit] ", stderr);
|
||||
(void)fputs("[-f archive] [-o options] ... \n", stderr);
|
||||
(void)fputs(" [-p string] ... [-s replstr] ... ", stderr);
|
||||
(void)fputs("[-U user] ... [-G group] ...\n ", stderr);
|
||||
(void)fputs(" [-p string] ... [-s replstr] ... ", stderr);
|
||||
(void)fputs("[-U user] ... [-G group] ...\n ", stderr);
|
||||
(void)fputs("[-T [from_date][,to_date]] ... ", stderr);
|
||||
(void)fputs(" [pattern ...]\n", stderr);
|
||||
(void)fputs(" pax -w [-dituvHLPX] [-b blocksize] ", stderr);
|
||||
(void)fputs("[ [-a] [-f archive] ] [-x format] \n", stderr);
|
||||
(void)fputs(" [-B bytes] [-s replstr] ... ", stderr);
|
||||
(void)fputs(" [-B bytes] [-s replstr] ... ", stderr);
|
||||
(void)fputs("[-o options] ... [-U user] ...", stderr);
|
||||
(void)fputs("\n [-G group] ... ", stderr);
|
||||
(void)fputs("\n [-G group] ... ", stderr);
|
||||
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
|
||||
(void)fputs("[file ...]\n", stderr);
|
||||
(void)fputs(" pax -r -w [-diklntuvDHLPXYZ] ", stderr);
|
||||
(void)fputs("[-p string] ... [-s replstr] ...", stderr);
|
||||
(void)fputs("\n [-U user] ... [-G group] ... ", stderr);
|
||||
(void)fputs("\n [-U user] ... [-G group] ... ", stderr);
|
||||
(void)fputs("[-T [from_date][,to_date][/[c][m]]] ... ", stderr);
|
||||
(void)fputs("\n [file ...] directory\n", stderr);
|
||||
(void)fputs("\n [file ...] directory\n", stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ main(argc, argv)
|
||||
* parse options, determine operational mode, general init
|
||||
*/
|
||||
options(argc, argv);
|
||||
if ((gen_init() < 0) || (tty_init() < 0))
|
||||
if ((gen_init() < 0) || (tty_init() < 0))
|
||||
return(exit_val);
|
||||
|
||||
/*
|
||||
|
@ -225,7 +225,7 @@ typedef struct oplist {
|
||||
* General Macros
|
||||
*/
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
#define MAJOR(x) major(x)
|
||||
#define MINOR(x) minor(x)
|
||||
@ -234,7 +234,7 @@ typedef struct oplist {
|
||||
/*
|
||||
* General Defines
|
||||
*/
|
||||
#define HEX 16
|
||||
#define OCT 8
|
||||
#define _PAX_ 1
|
||||
#define HEX 16
|
||||
#define OCT 8
|
||||
#define _PAX_ 1
|
||||
#define _TFILE_BASE "paxXXXXXXXXXX"
|
||||
|
@ -130,8 +130,8 @@ usr_add(str)
|
||||
return(-1);
|
||||
if ((usrtb == NULL) &&
|
||||
((usrtb = (USRT **)calloc(USR_TB_SZ, sizeof(USRT *))) == NULL)) {
|
||||
paxwarn(1, "Unable to allocate memory for user selection table");
|
||||
return(-1);
|
||||
paxwarn(1, "Unable to allocate memory for user selection table");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -144,11 +144,11 @@ usr_add(str)
|
||||
if ((str[0] == '\\') && (str[1] == '#'))
|
||||
++str;
|
||||
if ((pw = getpwnam(str)) == NULL) {
|
||||
paxwarn(1, "Unable to find uid for user: %s", str);
|
||||
return(-1);
|
||||
paxwarn(1, "Unable to find uid for user: %s", str);
|
||||
return(-1);
|
||||
}
|
||||
uid = (uid_t)pw->pw_uid;
|
||||
} else
|
||||
} else
|
||||
# ifdef NET2_STAT
|
||||
uid = (uid_t)atoi(str+1);
|
||||
# else
|
||||
@ -161,11 +161,11 @@ usr_add(str)
|
||||
*/
|
||||
indx = ((unsigned)uid) % USR_TB_SZ;
|
||||
if ((pt = usrtb[indx]) != NULL) {
|
||||
while (pt != NULL) {
|
||||
if (pt->uid == uid)
|
||||
while (pt != NULL) {
|
||||
if (pt->uid == uid)
|
||||
return(0);
|
||||
pt = pt->fow;
|
||||
}
|
||||
pt = pt->fow;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -177,8 +177,8 @@ usr_add(str)
|
||||
usrtb[indx] = pt;
|
||||
return(0);
|
||||
}
|
||||
paxwarn(1, "User selection table out of memory");
|
||||
return(-1);
|
||||
paxwarn(1, "User selection table out of memory");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -243,8 +243,8 @@ grp_add(str)
|
||||
return(-1);
|
||||
if ((grptb == NULL) &&
|
||||
((grptb = (GRPT **)calloc(GRP_TB_SZ, sizeof(GRPT *))) == NULL)) {
|
||||
paxwarn(1, "Unable to allocate memory fo group selection table");
|
||||
return(-1);
|
||||
paxwarn(1, "Unable to allocate memory fo group selection table");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -257,11 +257,11 @@ grp_add(str)
|
||||
if ((str[0] == '\\') && (str[1] == '#'))
|
||||
++str;
|
||||
if ((gr = getgrnam(str)) == NULL) {
|
||||
paxwarn(1,"Cannot determine gid for group name: %s", str);
|
||||
return(-1);
|
||||
paxwarn(1,"Cannot determine gid for group name: %s", str);
|
||||
return(-1);
|
||||
}
|
||||
gid = (gid_t)gr->gr_gid;
|
||||
} else
|
||||
} else
|
||||
# ifdef NET2_STAT
|
||||
gid = (gid_t)atoi(str+1);
|
||||
# else
|
||||
@ -274,11 +274,11 @@ grp_add(str)
|
||||
*/
|
||||
indx = ((unsigned)gid) % GRP_TB_SZ;
|
||||
if ((pt = grptb[indx]) != NULL) {
|
||||
while (pt != NULL) {
|
||||
if (pt->gid == gid)
|
||||
while (pt != NULL) {
|
||||
if (pt->gid == gid)
|
||||
return(0);
|
||||
pt = pt->fow;
|
||||
}
|
||||
pt = pt->fow;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -290,8 +290,8 @@ grp_add(str)
|
||||
grptb[indx] = pt;
|
||||
return(0);
|
||||
}
|
||||
paxwarn(1, "Group selection table out of memory");
|
||||
return(-1);
|
||||
paxwarn(1, "Group selection table out of memory");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -116,9 +116,9 @@ lnk_start()
|
||||
if (ltab != NULL)
|
||||
return(0);
|
||||
if ((ltab = (HRDLNK **)calloc(L_TAB_SZ, sizeof(HRDLNK *))) == NULL) {
|
||||
paxwarn(1, "Cannot allocate memory for hard link table");
|
||||
return(-1);
|
||||
}
|
||||
paxwarn(1, "Cannot allocate memory for hard link table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -360,12 +360,13 @@ int
|
||||
ftime_start()
|
||||
#endif
|
||||
{
|
||||
|
||||
if (ftab != NULL)
|
||||
return(0);
|
||||
if ((ftab = (FTM **)calloc(F_TAB_SZ, sizeof(FTM *))) == NULL) {
|
||||
paxwarn(1, "Cannot allocate memory for file time table");
|
||||
return(-1);
|
||||
}
|
||||
paxwarn(1, "Cannot allocate memory for file time table");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* get random name and create temporary scratch file, unlink name
|
||||
@ -530,9 +531,9 @@ name_start()
|
||||
if (ntab != NULL)
|
||||
return(0);
|
||||
if ((ntab = (NAMT **)calloc(N_TAB_SZ, sizeof(NAMT *))) == NULL) {
|
||||
paxwarn(1, "Cannot allocate memory for interactive rename table");
|
||||
return(-1);
|
||||
}
|
||||
paxwarn(1, "Cannot allocate memory for interactive rename table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -723,9 +724,9 @@ dev_start()
|
||||
if (dtab != NULL)
|
||||
return(0);
|
||||
if ((dtab = (DEVT **)calloc(D_TAB_SZ, sizeof(DEVT *))) == NULL) {
|
||||
paxwarn(1, "Cannot allocate memory for device mapping table");
|
||||
return(-1);
|
||||
}
|
||||
paxwarn(1, "Cannot allocate memory for device mapping table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -992,9 +993,9 @@ atdir_start()
|
||||
if (atab != NULL)
|
||||
return(0);
|
||||
if ((atab = (ATDIR **)calloc(A_TAB_SZ, sizeof(ATDIR *))) == NULL) {
|
||||
paxwarn(1,"Cannot allocate space for directory access time table");
|
||||
return(-1);
|
||||
}
|
||||
paxwarn(1,"Cannot allocate space for directory access time table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -1206,6 +1207,7 @@ int
|
||||
dir_start()
|
||||
#endif
|
||||
{
|
||||
|
||||
if (dirfd != -1)
|
||||
return(0);
|
||||
|
||||
@ -1379,7 +1381,7 @@ st_hash(name, len, tabsz)
|
||||
* spread out the keys)
|
||||
*/
|
||||
if (len > MAXKEYLEN) {
|
||||
pt = &(name[len - MAXKEYLEN]);
|
||||
pt = &(name[len - MAXKEYLEN]);
|
||||
len = MAXKEYLEN;
|
||||
} else
|
||||
pt = name;
|
||||
|
@ -62,7 +62,7 @@ static const char rcsid[] =
|
||||
* routines that deal with I/O to and from the user
|
||||
*/
|
||||
|
||||
#define DEVTTY "/dev/tty" /* device for interactive i/o */
|
||||
#define DEVTTY "/dev/tty" /* device for interactive i/o */
|
||||
static FILE *ttyoutf = NULL; /* output pointing at control tty */
|
||||
static FILE *ttyinf = NULL; /* input pointing at control tty */
|
||||
|
||||
@ -82,7 +82,7 @@ tty_init()
|
||||
{
|
||||
int ttyfd;
|
||||
|
||||
if ((ttyfd = open(DEVTTY, O_RDWR)) >= 0) {
|
||||
if ((ttyfd = open(DEVTTY, O_RDWR)) >= 0) {
|
||||
if ((ttyoutf = fdopen(ttyfd, "w")) != NULL) {
|
||||
if ((ttyinf = fdopen(ttyfd, "r")) != NULL)
|
||||
return(0);
|
||||
|
Loading…
Reference in New Issue
Block a user