Remove crufty build options that are not relevant.
authorPeter Avalos <pavalos@dragonflybsd.org>
Wed, 27 Sep 2006 19:18:00 +0000 (19:18 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Wed, 27 Sep 2006 19:18:00 +0000 (19:18 +0000)
12 files changed:
bin/pax/Makefile
bin/pax/ar_io.c
bin/pax/cache.c
bin/pax/cpio.c
bin/pax/extern.h
bin/pax/ftree.c
bin/pax/gen_subs.c
bin/pax/options.c
bin/pax/pat_rep.c
bin/pax/pat_rep.h
bin/pax/sel_subs.c
bin/pax/tar.c

index db86f84..279d368 100644 (file)
@@ -1,30 +1,6 @@
 #       @(#)Makefile   8.1 (Berkeley) 5/31/93
 # $FreeBSD: src/bin/pax/Makefile,v 1.5.2.1 2001/08/01 05:03:11 obrien Exp $
-# $DragonFly: src/bin/pax/Makefile,v 1.4 2005/02/06 06:16:40 okumoto Exp $
-
-# To install on versions prior to BSD 4.4 the following may have to be
-# defined with CFLAGS +=
-#
-# -DNET2_STAT  Use NET2 or older stat structure. The version of the
-#              stat structure is easily determined by looking at the
-#              basic type of an off_t (often defined in the file:
-#              /usr/include/sys/types.h). If off_t is a long (and is
-#              NOT A quad) then you must define NET2_STAT.
-#              This define is important, as if you do have a quad_t
-#              off_t and define NET2_STAT, pax will compile but will
-#              NOT RUN PROPERLY.
-#
-# -DNET2_FTS   Use the older NET2 fts. To identify the version,
-#              examine the file: /usr/include/fts.h. If FTS_COMFOLLOW
-#              is not defined then you must define NET2_FTS.
-#              Pax may not compile if this not (un)defined properly.
-#
-# -DNET2_REGEX Use the older regexp.h not regex.h. The regex version
-#              is determined by looking at the value returned by
-#              regexec() (man 3 regexec). If regexec return a 1 for
-#              success (and NOT a 0 for success) you have the older
-#              regex routines and must define NET2_REGEX.
-#              Pax may not compile if this not (un)defined properly.
+# $DragonFly: src/bin/pax/Makefile,v 1.5 2006/09/27 19:18:00 pavalos Exp $
 
 PROG=   pax
 SRCS=  ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \
index d853a0f..30b12a2 100644 (file)
@@ -36,7 +36,7 @@
  *
  * @(#)ar_io.c 8.2 (Berkeley) 4/18/94
  * $FreeBSD: src/bin/pax/ar_io.c,v 1.12.2.1 2001/08/01 05:03:11 obrien Exp $
- * $DragonFly: src/bin/pax/ar_io.c,v 1.9 2004/11/07 20:54:51 eirikn Exp $
+ * $DragonFly: src/bin/pax/ar_io.c,v 1.10 2006/09/27 19:18:00 pavalos Exp $
  */
 
 #include <sys/types.h>
@@ -383,11 +383,7 @@ ar_close(void)
         * could have written anything yet.
         */
        if (frmt == NULL) {
-#      ifdef NET2_STAT
-               fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
-#      else
                fprintf(listf, "%s: unknown format, %qu bytes skipped.\n",
-#      endif
                    argv0, rdcnt);
                fflush(listf);
                flcnt = 0;
@@ -398,11 +394,7 @@ ar_close(void)
                fprintf(listf, "%qu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120);
        else if (strcmp(NM_TAR, argv0) != 0)
                fprintf(listf,
-#      ifdef NET2_STAT
-                   "%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);
        fflush(listf);
        flcnt = 0;
index a33f3d1..ca90454 100644 (file)
@@ -36,7 +36,7 @@
  *
  * @(#)cache.c 8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/bin/pax/cache.c,v 1.12.2.1 2001/08/01 05:03:11 obrien Exp $
- * $DragonFly: src/bin/pax/cache.c,v 1.5 2004/11/07 20:54:51 eirikn Exp $
+ * $DragonFly: src/bin/pax/cache.c,v 1.6 2006/09/27 19:18:00 pavalos Exp $
  */
 
 #include <sys/types.h>
@@ -210,12 +210,8 @@ name_uid(uid_t uid, int frc)
                        return("");
                ptr->uid = uid;
                ptr->valid = INVALID;
-#              ifdef NET2_STAT
-               snprintf(ptr->name, sizeof(ptr->name), "%u", uid);
-#              else
                snprintf(ptr->name, sizeof(ptr->name), "%lu",
                               (unsigned long)uid);
-#              endif
                if (frc == 0)
                        return("");
        } else {
@@ -281,12 +277,8 @@ name_gid(gid_t gid, int frc)
                        return("");
                ptr->gid = gid;
                ptr->valid = INVALID;
-#              ifdef NET2_STAT
-               snprintf(ptr->name, sizeof(ptr->name), "%u", gid);
-#              else
                snprintf(ptr->name, sizeof(ptr->name), "%lu",
                               (unsigned long)gid);
-#              endif
                if (frc == 0)
                        return("");
        } else {
index 97b4e05..350d034 100644 (file)
@@ -36,7 +36,7 @@
  *
  * @(#)cpio.c  8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/bin/pax/cpio.c,v 1.12.2.1 2001/08/01 05:03:11 obrien Exp $
- * $DragonFly: src/bin/pax/cpio.c,v 1.6 2004/11/07 20:54:51 eirikn Exp $
+ * $DragonFly: src/bin/pax/cpio.c,v 1.7 2006/09/27 19:18:00 pavalos Exp $
  */
 
 #include <sys/types.h>
@@ -215,13 +215,8 @@ rd_ln_nm(ARCHD *arcn)
         */
        if ((arcn->sb.st_size == 0) ||
            (arcn->sb.st_size >= sizeof(arcn->ln_name))) {
-#              ifdef NET2_STAT
-               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);
        }
 
@@ -304,13 +299,8 @@ cpio_rd(ARCHD *arcn, char *buf)
        arcn->sb.st_mtime = (time_t)asc_ul(hd->c_mtime, sizeof(hd->c_mtime),
            OCT);
        arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime;
-#      ifdef NET2_STAT
-       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
@@ -405,13 +395,8 @@ cpio_wr(ARCHD *arcn)
                /*
                 * set data size for file data
                 */
-#              ifdef NET2_STAT
-               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);
@@ -589,13 +574,8 @@ vcpio_rd(ARCHD *arcn, char *buf)
        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 NET2_STAT
-       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);
@@ -730,13 +710,8 @@ vcpio_wr(ARCHD *arcn)
                 * much to pad.
                 */
                arcn->pad = VCPIO_PAD(arcn->sb.st_size);
-#              ifdef NET2_STAT
-               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);
index 1df5ae1..1e3801a 100644 (file)
@@ -36,7 +36,7 @@
  *
  *     @(#)extern.h    8.2 (Berkeley) 4/18/94
  * $FreeBSD: src/bin/pax/extern.h,v 1.6.2.2 2001/08/01 05:03:11 obrien Exp $
- * $DragonFly: src/bin/pax/extern.h,v 1.4 2004/10/30 13:34:50 liamfoy Exp $
+ * $DragonFly: src/bin/pax/extern.h,v 1.5 2006/09/27 19:18:00 pavalos Exp $
  */
 
 /*
@@ -171,10 +171,8 @@ void ls_tty (ARCHD *);
 int l_strncpy (char *, char *, int);
 u_long asc_ul (char *, int, int);
 int ul_asc (u_long, char *, int, int);
-#ifndef NET2_STAT
 u_quad_t asc_uqd (char *, int, int);
 int uqd_asc (u_quad_t, char *, int, int);
-#endif
 
 /*
  * getoldopt.c
index f4b4dde..ded011d 100644 (file)
@@ -36,7 +36,7 @@
  *
  * @(#)ftree.c 8.2 (Berkeley) 4/18/94
  * $FreeBSD: src/bin/pax/ftree.c,v 1.13.2.1 2001/08/01 05:03:11 obrien Exp $
- * $DragonFly: src/bin/pax/ftree.c,v 1.6 2004/11/07 20:54:51 eirikn Exp $
+ * $DragonFly: src/bin/pax/ftree.c,v 1.7 2006/09/27 19:18:00 pavalos Exp $
  */
 
 #include <sys/types.h>
@@ -113,11 +113,7 @@ ftree_start(void)
        else
                ftsopts |= FTS_PHYSICAL;
        if (Hflag)
-#      ifdef NET2_FTS
-               paxwarn(0, "The -H flag is not supported on this version");
-#      else
                ftsopts |= FTS_COMFOLLOW;
-#      endif
        if (Xflag)
                ftsopts |= FTS_XDEV;
 
@@ -388,13 +384,8 @@ next_file(ARCHD *arcn)
                         * remember to force the time (this is -t on a read
                         * directory, not a created directory).
                         */
-#                      ifdef NET2_FTS
-                       if (!tflag || (get_atdir(ftent->fts_statb.st_dev,
-                           ftent->fts_statb.st_ino, &mtime, &atime) < 0))
-#                      else
                        if (!tflag || (get_atdir(ftent->fts_statp->st_dev,
                            ftent->fts_statp->st_ino, &mtime, &atime) < 0))
-#                      endif
                                continue;
                        set_ftime(ftent->fts_path, mtime, atime, 1);
                        continue;
@@ -405,28 +396,16 @@ next_file(ARCHD *arcn)
                        paxwarn(1,"File system cycle found at %s",ftent->fts_path);
                        continue;
                case FTS_DNR:
-#                      ifdef NET2_FTS
-                       syswarn(1, errno,
-#                      else
                        syswarn(1, ftent->fts_errno,
-#                      endif
                            "Unable to read directory %s", ftent->fts_path);
                        continue;
                case FTS_ERR:
-#                      ifdef NET2_FTS
-                       syswarn(1, errno,
-#                      else
                        syswarn(1, ftent->fts_errno,
-#                      endif
                            "File system traversal error");
                        continue;
                case FTS_NS:
                case FTS_NSOK:
-#                      ifdef NET2_FTS
-                       syswarn(1, errno,
-#                      else
                        syswarn(1, ftent->fts_errno,
-#                      endif
                            "Unable to access %s", ftent->fts_path);
                        continue;
                }
@@ -439,11 +418,7 @@ next_file(ARCHD *arcn)
                arcn->pad = 0;
                arcn->ln_nlen = 0;
                arcn->ln_name[0] = '\0';
-#              ifdef NET2_FTS
-               arcn->sb = ftent->fts_statb;
-#              else
                arcn->sb = *(ftent->fts_statp);
-#              endif
 
                /*
                 * file type based set up and copy into the arcn struct
index 71190ba..14bf6db 100644 (file)
@@ -36,7 +36,7 @@
  *
  * @(#)gen_subs.c      8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/bin/pax/gen_subs.c,v 1.12.2.4 2002/03/12 17:49:17 phantom Exp $
- * $DragonFly: src/bin/pax/gen_subs.c,v 1.5 2004/11/07 20:54:51 eirikn Exp $
+ * $DragonFly: src/bin/pax/gen_subs.c,v 1.6 2006/09/27 19:18:00 pavalos Exp $
  */
 
 #include <sys/types.h>
@@ -123,19 +123,10 @@ ls_list(ARCHD *arcn, time_t now, FILE *fp)
         * print device id's for devices, or sizes for other nodes
         */
        if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK))
-#              ifdef NET2_STAT
-               fprintf(fp, "%4u,%4u ", MAJOR(sbp->st_rdev),
-                   MINOR(sbp->st_rdev));
-#              else
                fprintf(fp, "%4lu,%4lu ", (unsigned long)MAJOR(sbp->st_rdev),
                    (unsigned long)MINOR(sbp->st_rdev));
-#              endif
        else {
-#              ifdef NET2_STAT
-               fprintf(fp, "%9lu ", sbp->st_size);
-#              else
                fprintf(fp, "%9qu ", sbp->st_size);
-#              endif
        }
 
        /*
@@ -304,7 +295,6 @@ ul_asc(u_long val, char *str, int len, int base)
        return(0);
 }
 
-#ifndef NET2_STAT
 /*
  * asc_uqd()
  *     convert hex/octal character string into a u_quad_t. We do not have to
@@ -400,4 +390,3 @@ uqd_asc(u_quad_t val, char *str, int len, int base)
                return(-1);
        return(0);
 }
-#endif
index d0d857a..40c0e4e 100644 (file)
@@ -36,7 +36,7 @@
  *
  * @(#)options.c       8.2 (Berkeley) 4/18/94
  * $FreeBSD: src/bin/pax/options.c,v 1.13.2.3 2001/08/01 05:03:11 obrien Exp $
- * $DragonFly: src/bin/pax/options.c,v 1.6 2004/11/07 20:54:51 eirikn Exp $
+ * $DragonFly: src/bin/pax/options.c,v 1.7 2006/09/27 19:18:00 pavalos Exp $
  */
 
 #include <sys/types.h>
@@ -1415,13 +1415,8 @@ str_offt(char *val)
        char *expr;
        off_t num, t;
 
-#      ifdef NET2_STAT
-       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) {
index 675d6b0..2770cdf 100644 (file)
@@ -36,7 +36,7 @@
  *
  * @(#)pat_rep.c       8.2 (Berkeley) 4/18/94
  * $FreeBSD: src/bin/pax/pat_rep.c,v 1.15.2.1 2001/08/01 05:03:11 obrien Exp $
- * $DragonFly: src/bin/pax/pat_rep.c,v 1.6 2004/11/07 20:54:51 eirikn Exp $
+ * $DragonFly: src/bin/pax/pat_rep.c,v 1.7 2006/09/27 19:18:00 pavalos Exp $
  */
 
 #include <sys/types.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <errno.h>
-#ifdef NET2_REGEX
-#include <regexp.h>
-#else
 #include <regex.h>
-#endif
 #include "pax.h"
 #include "pat_rep.h"
 #include "extern.h"
@@ -73,11 +69,7 @@ static int tty_rename (ARCHD *);
 static int fix_path (char *, int *, char *, int);
 static int fn_match (char *, char *, char **);
 static char * range_match (char *, int);
-#ifdef NET2_REGEX
-static int resub (regexp *, char *, char *, char *);
-#else
 static int resub (regex_t *, regmatch_t *, char *, char *, char *);
-#endif
 
 /*
  * rep_add()
@@ -101,10 +93,8 @@ rep_add(char *str)
        char *pt1;
        char *pt2;
        REPLACE *rep;
-#      ifndef NET2_REGEX
        int res;
        char rebuf[BUFSIZ];
-#      endif
 
        /*
         * throw out the bad parameters
@@ -133,13 +123,9 @@ rep_add(char *str)
        }
 
        *pt1 = '\0';
-#      ifdef NET2_REGEX
-       if ((rep->rcmp = regcomp(str+1)) == NULL) {
-#      else
        if ((res = regcomp(&(rep->rcmp), str+1, 0)) != 0) {
                regerror(res, &(rep->rcmp), rebuf, sizeof(rebuf));
                paxwarn(1, "%s while compiling regular expression %s", rebuf, str);
-#      endif
                free((char *)rep);
                return(-1);
        }
@@ -151,11 +137,7 @@ rep_add(char *str)
         */
        *pt1++ = *str;
        if ((pt2 = strchr(pt1, *str)) == NULL) {
-#              ifdef NET2_REGEX
-               free((char *)rep->rcmp);
-#              else
                regfree(&(rep->rcmp));
-#              endif
                free((char *)rep);
                paxwarn(1, "Invalid replacement string %s", str);
                return(-1);
@@ -180,11 +162,7 @@ rep_add(char *str)
                        rep->flgs  |= PRNT;
                        break;
                default:
-#                      ifdef NET2_REGEX
-                       free((char *)rep->rcmp);
-#                      else
                        regfree(&(rep->rcmp));
-#                      endif
                        free((char *)rep);
                        *pt1 = *str;
                        paxwarn(1, "Invalid replacement string option %s", str);
@@ -865,9 +843,7 @@ rep_name(char *name, int *nlen, int prnt)
        char *rpt;
        int found = 0;
        int res;
-#      ifndef NET2_REGEX
        regmatch_t pm[MAXSUBEXP];
-#      endif
        char nname[PAXPATHLEN+1];       /* final result of all replacements */
        char buf1[PAXPATHLEN+1];        /* where we work on the name */
 
@@ -894,11 +870,7 @@ rep_name(char *name, int *nlen, int prnt)
                         * check for a successful substitution, if not go to
                         * the next pattern, or cleanup if we were global
                         */
-#                      ifdef NET2_REGEX
-                       if (regexec(pt->rcmp, inpt) == 0)
-#                      else
                        if (regexec(&(pt->rcmp), inpt, MAXSUBEXP, pm, 0) != 0)
-#                      endif
                                break;
 
                        /*
@@ -909,11 +881,7 @@ rep_name(char *name, int *nlen, int prnt)
                         * do not create a string too long).
                         */
                        found = 1;
-#                      ifdef NET2_REGEX
-                       rpt = pt->rcmp->startp[0];
-#                      else
                        rpt = inpt + pm[0].rm_so;
-#                      endif
 
                        while ((inpt < rpt) && (outpt < endpt))
                                *outpt++ = *inpt++;
@@ -926,12 +894,8 @@ rep_name(char *name, int *nlen, int prnt)
                         * replacement string and place it the prefix in the
                         * final output. If we have problems, skip it.
                         */
-#                      ifdef NET2_REGEX
-                       if ((res = resub(pt->rcmp,pt->nstr,outpt,endpt)) < 0) {
-#                      else
                        if ((res = resub(&(pt->rcmp),pm,pt->nstr,outpt,endpt))
                            < 0) {
-#                      endif
                                if (prnt)
                                        paxwarn(1, "Replacement name error %s",
                                            name);
@@ -949,11 +913,7 @@ rep_name(char *name, int *nlen, int prnt)
                         * the final result. Make sure we do not overrun the
                         * output buffer
                         */
-#                      ifdef NET2_REGEX
-                       inpt = pt->rcmp->endp[0];
-#                      else
                        inpt += pm[0].rm_eo - pm[0].rm_so;
-#                      endif
 
                        if ((outpt == endpt) || (*inpt == '\0'))
                                break;
@@ -1012,56 +972,6 @@ rep_name(char *name, int *nlen, int prnt)
        return(0);
 }
 
-#ifdef NET2_REGEX
-/*
- * resub()
- *     apply the replacement to the matched expression. expand out the old
- *     style ed(1) subexpression expansion.
- * Return:
- *     -1 if error, or the number of characters added to the destination.
- */
-
-static int
-resub(regexp *prog, char *src, char *dest, char *destend)
-{
-       char *spt;
-       char *dpt;
-       char c;
-       int no;
-       int len;
-
-       spt = src;
-       dpt = dest;
-       while ((dpt < destend) && ((c = *spt++) != '\0')) {
-               if (c == '&')
-                       no = 0;
-               else if ((c == '\\') && (*spt >= '0') && (*spt <= '9'))
-                       no = *spt++ - '0';
-               else {
-                       if ((c == '\\') && ((*spt == '\\') || (*spt == '&')))
-                               c = *spt++;
-                       *dpt++ = c;
-                       continue;
-               }
-               if ((prog->startp[no] == NULL) || (prog->endp[no] == NULL) ||
-                   ((len = prog->endp[no] - prog->startp[no]) <= 0))
-                       continue;
-
-               /*
-                * copy the subexpression to the destination.
-                * fail if we run out of space or the match string is damaged
-                */
-               if (len > (destend - dpt))
-                       len = destend - dpt;
-               if (l_strncpy(dpt, prog->startp[no], len) != len)
-                       return(-1);
-               dpt += len;
-       }
-       return(dpt - dest);
-}
-
-#else
-
 /*
  * resub()
  *     apply the replacement to the matched expression. expand out the old
@@ -1127,4 +1037,3 @@ resub(regex_t *rp, regmatch_t *pm, char *src, char *dest,
        }
        return(dpt - dest);
 }
-#endif
index 3fd88ec..dc8313b 100644 (file)
@@ -36,7 +36,7 @@
  *
  *     @(#)pat_rep.h   8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/bin/pax/pat_rep.h,v 1.5 1999/08/27 23:14:44 peter Exp $
- * $DragonFly: src/bin/pax/pat_rep.h,v 1.2 2003/06/17 04:22:50 dillon Exp $
+ * $DragonFly: src/bin/pax/pat_rep.h,v 1.3 2006/09/27 19:18:00 pavalos Exp $
  */
 
 /*
  */
 typedef struct replace {
        char            *nstr;  /* the new string we will substitute with */
-#      ifdef NET2_REGEX
-       regexp          *rcmp;  /* compiled regular expression used to match */
-#      else
        regex_t         rcmp;   /* compiled regular expression used to match */
-#      endif
        int             flgs;   /* print conversions? global in operation?  */
 #define        PRNT            0x1
 #define        GLOB            0x2
index 7c12c62..e9e34b6 100644 (file)
@@ -36,7 +36,7 @@
  *
  * @(#)sel_subs.c      8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/bin/pax/sel_subs.c,v 1.11.2.1 2001/08/01 05:03:11 obrien Exp $
- * $DragonFly: src/bin/pax/sel_subs.c,v 1.6 2004/11/07 20:54:51 eirikn Exp $
+ * $DragonFly: src/bin/pax/sel_subs.c,v 1.7 2006/09/27 19:18:00 pavalos Exp $
  */
 
 #include <sys/types.h>
@@ -133,11 +133,7 @@ usr_add(char *str)
                }
                uid = (uid_t)pw->pw_uid;
        } else
-#              ifdef NET2_STAT
-               uid = (uid_t)atoi(str+1);
-#              else
                uid = (uid_t)strtoul(str+1, NULL, 10);
-#              endif
        endpwent();
 
        /*
@@ -234,11 +230,7 @@ grp_add(char *str)
                }
                gid = (gid_t)gr->gr_gid;
        } else
-#              ifdef NET2_STAT
-               gid = (gid_t)atoi(str+1);
-#              else
                gid = (gid_t)strtoul(str+1, NULL, 10);
-#              endif
        endgrent();
 
        /*
index 317f5d4..d770489 100644 (file)
@@ -36,7 +36,7 @@
  *
  * @(#)tar.c   8.2 (Berkeley) 4/18/94
  * $FreeBSD: src/bin/pax/tar.c,v 1.13.2.1 2001/08/01 05:03:12 obrien Exp $
- * $DragonFly: src/bin/pax/tar.c,v 1.5 2004/10/30 13:34:50 liamfoy Exp $
+ * $DragonFly: src/bin/pax/tar.c,v 1.6 2006/09/27 19:18:00 pavalos Exp $
  */
 
 #include <sys/types.h>
@@ -57,9 +57,7 @@
 static u_long tar_chksm (char *, int);
 static char *name_split (char *, int);
 static int ul_oct (u_long, char *, int, int);
-#ifndef NET2_STAT
 static int uqd_oct (u_quad_t, char *, int, int);
-#endif
 
 /*
  * Routines common to all versions of tar
@@ -190,7 +188,6 @@ ul_oct(u_long val, char *str, int len, int term)
        return(0);
 }
 
-#ifndef NET2_STAT
 /*
  * uqd_oct()
  *     convert an u_quad_t to an octal string. one of many oddball field
@@ -244,7 +241,6 @@ uqd_oct(u_quad_t val, char *str, int len, int term)
                return(-1);
        return(0);
 }
-#endif
 
 /*
  * tar_chksm()
@@ -393,11 +389,7 @@ tar_rd(ARCHD *arcn, char *buf)
            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 NET2_STAT
-       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
        arcn->sb.st_mtime = (time_t)asc_ul(hd->mtime, sizeof(hd->mtime), OCT);
        arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime;
 
@@ -602,13 +594,8 @@ tar_wr(ARCHD *arcn)
                 */
                hd->linkflag = AREGTYPE;
                memset(hd->linkname, 0, sizeof(hd->linkname));
-#              ifdef NET2_STAT
-               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);
                }
@@ -762,11 +749,7 @@ ustar_rd(ARCHD *arcn, char *buf)
         */
        arcn->sb.st_mode = (mode_t)(asc_ul(hd->mode, sizeof(hd->mode), OCT) &
            0xfff);
-#ifdef NET2_STAT
-       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
        arcn->sb.st_mtime = (time_t)asc_ul(hd->mtime, sizeof(hd->mtime), OCT);
        arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime;
 
@@ -996,13 +979,8 @@ ustar_wr(ARCHD *arcn)
                memset(hd->devmajor, 0, sizeof(hd->devmajor));
                memset(hd->devminor, 0, sizeof(hd->devminor));
                arcn->pad = TAR_PAD(arcn->sb.st_size);
-#              ifdef NET2_STAT
-               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);
                }