-# $OpenBSD: Makefile,v 1.10 2001/05/26 00:32:20 millert Exp $
-
-# To install on versions prior to BSD 4.4 the following may have to be
-# defined with CFLAGS +=
-#
-# -DLONG_OFF_T Define this if the base type of an off_t is a long (and is
-# NOT a quad). (This is often defined in the file
-# /usr/include/sys/types.h).
-# This define is important, as if you do have a quad_t
-# off_t and define LONG_OFF_T, pax will compile but will
-# NOT RUN PROPERLY.
-#
+# $OpenBSD: Makefile,v 1.11 2014/01/08 04:58:36 guenther Exp $
PROG= pax
SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c\
-/* $OpenBSD: ar_io.c,v 1.41 2014/01/08 04:42:24 guenther Exp $ */
+/* $OpenBSD: ar_io.c,v 1.42 2014/01/08 04:58:36 guenther Exp $ */
/* $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $ */
/*-
* could have written anything yet.
*/
if (frmt == NULL) {
-# ifdef LONG_OFF_T
- (void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
-# else
(void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n",
-# endif
argv0, rdcnt);
(void)fflush(listf);
flcnt = 0;
(void)fprintf(listf, "%qu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120);
else if (strcmp(NM_TAR, argv0) != 0)
(void)fprintf(listf,
-# ifdef LONG_OFF_T
- "%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",
-# endif
argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt);
(void)fflush(listf);
flcnt = 0;
-/* $OpenBSD: cpio.c,v 1.22 2013/07/03 04:08:29 guenther Exp $ */
+/* $OpenBSD: cpio.c,v 1.23 2014/01/08 04:58:36 guenther Exp $ */
/* $NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $ */
/*-
*/
if ((arcn->sb.st_size == 0) ||
(arcn->sb.st_size >= sizeof(arcn->ln_name))) {
-# ifdef LONG_OFF_T
- paxwarn(1, "Cpio link name length is invalid: %lu",
- arcn->sb.st_size);
-# else
paxwarn(1, "Cpio link name length is invalid: %qu",
arcn->sb.st_size);
-# endif
return(-1);
}
else
arcn->sb.st_mtime = val;
arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime;
-# ifdef LONG_OFF_T
- arcn->sb.st_size = (off_t)asc_ul(hd->c_filesize,sizeof(hd->c_filesize),
- OCT);
-# else
arcn->sb.st_size = (off_t)asc_uqd(hd->c_filesize,sizeof(hd->c_filesize),
OCT);
-# endif
/*
* check name size and if valid, read in the name of this entry (name
/*
* set data size for file data
*/
-# ifdef LONG_OFF_T
- if (ul_asc((u_long)arcn->sb.st_size, hd->c_filesize,
- sizeof(hd->c_filesize), OCT)) {
-# else
if (uqd_asc((u_quad_t)arcn->sb.st_size, hd->c_filesize,
sizeof(hd->c_filesize), OCT)) {
-# endif
paxwarn(1,"File is too large for cpio format %s",
arcn->org_name);
return(1);
arcn->sb.st_gid = (gid_t)asc_ul(hd->c_gid, sizeof(hd->c_gid), HEX);
arcn->sb.st_mtime = (time_t)asc_ul(hd->c_mtime,sizeof(hd->c_mtime),HEX);
arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime;
-# ifdef LONG_OFF_T
- arcn->sb.st_size = (off_t)asc_ul(hd->c_filesize,
- sizeof(hd->c_filesize), HEX);
-# else
arcn->sb.st_size = (off_t)asc_uqd(hd->c_filesize,
sizeof(hd->c_filesize), HEX);
-# endif
arcn->sb.st_nlink = (nlink_t)asc_ul(hd->c_nlink, sizeof(hd->c_nlink),
HEX);
devmajor = (dev_t)asc_ul(hd->c_maj, sizeof(hd->c_maj), HEX);
* much to pad.
*/
arcn->pad = VCPIO_PAD(arcn->sb.st_size);
-# ifdef LONG_OFF_T
- if (ul_asc((u_long)arcn->sb.st_size, hd->c_filesize,
- sizeof(hd->c_filesize), HEX)) {
-# else
if (uqd_asc((u_quad_t)arcn->sb.st_size, hd->c_filesize,
sizeof(hd->c_filesize), HEX)) {
-# endif
paxwarn(1,"File is too large for sv4cpio format %s",
arcn->org_name);
return(1);
-/* $OpenBSD: gen_subs.c,v 1.22 2013/07/03 04:08:29 guenther Exp $ */
+/* $OpenBSD: gen_subs.c,v 1.23 2014/01/08 04:58:36 guenther Exp $ */
/* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */
/*-
* print device id's for devices, or sizes for other nodes
*/
if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK))
-# ifdef LONG_OFF_T
- (void)fprintf(fp, "%4u,%4u ", MAJOR(sbp->st_rdev),
-# else
(void)fprintf(fp, "%4lu,%4lu ", (unsigned long)MAJOR(sbp->st_rdev),
-# endif
(unsigned long)MINOR(sbp->st_rdev));
else {
-# ifdef LONG_OFF_T
- (void)fprintf(fp, "%9lu ", sbp->st_size);
-# else
(void)fprintf(fp, "%9qu ", sbp->st_size);
-# endif
}
/*
-/* $OpenBSD: options.c,v 1.77 2013/03/27 17:14:10 zhuk Exp $ */
+/* $OpenBSD: options.c,v 1.78 2014/01/08 04:58:36 guenther Exp $ */
/* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */
/*-
char *expr;
off_t num, t;
-# ifdef LONG_OFF_T
- num = strtol(val, &expr, 0);
- if ((num == LONG_MAX) || (num <= 0) || (expr == val))
-# else
num = strtoq(val, &expr, 0);
if ((num == QUAD_MAX) || (num <= 0) || (expr == val))
-# endif
return(0);
switch (*expr) {
-/* $OpenBSD: tar.c,v 1.50 2014/01/08 04:41:41 guenther Exp $ */
+/* $OpenBSD: tar.c,v 1.51 2014/01/08 04:58:36 guenther Exp $ */
/* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */
/*-
0xfff);
arcn->sb.st_uid = (uid_t)asc_ul(hd->uid, sizeof(hd->uid), OCT);
arcn->sb.st_gid = (gid_t)asc_ul(hd->gid, sizeof(hd->gid), OCT);
-#ifdef LONG_OFF_T
- arcn->sb.st_size = (off_t)asc_ul(hd->size, sizeof(hd->size), OCT);
-#else
arcn->sb.st_size = (off_t)asc_uqd(hd->size, sizeof(hd->size), OCT);
-#endif
val = asc_uqd(hd->mtime, sizeof(hd->mtime), OCT);
if ((time_t)val < 0 || (time_t)val != val)
arcn->sb.st_mtime = INT_MAX; /* XXX 2038 */
* data follows this file, so set the pad
*/
hd->linkflag = AREGTYPE;
-# ifdef LONG_OFF_T
- if (ul_oct((u_long)arcn->sb.st_size, hd->size,
- sizeof(hd->size), 1)) {
-# else
if (uqd_oct((u_quad_t)arcn->sb.st_size, hd->size,
sizeof(hd->size), 1)) {
-# endif
paxwarn(1,"File is too large for tar %s", arcn->org_name);
return(1);
}
*/
arcn->sb.st_mode = (mode_t)(asc_ul(hd->mode, sizeof(hd->mode), OCT) &
0xfff);
-#ifdef LONG_OFF_T
- arcn->sb.st_size = (off_t)asc_ul(hd->size, sizeof(hd->size), OCT);
-#else
arcn->sb.st_size = (off_t)asc_uqd(hd->size, sizeof(hd->size), OCT);
-#endif
val = asc_uqd(hd->mtime, sizeof(hd->mtime), OCT);
if ((time_t)val < 0 || (time_t)val != val)
arcn->sb.st_mtime = INT_MAX; /* XXX 2038 */
else
hd->typeflag = REGTYPE;
arcn->pad = TAR_PAD(arcn->sb.st_size);
-# ifdef LONG_OFF_T
- if (ul_oct((u_long)arcn->sb.st_size, hd->size,
- sizeof(hd->size), 3)) {
-# else
if (uqd_oct((u_quad_t)arcn->sb.st_size, hd->size,
sizeof(hd->size), 3)) {
-# endif
paxwarn(1,"File is too long for ustar %s",arcn->org_name);
return(1);
}