Changeset 2715
- Timestamp:
- 06/05/07 16:52:44 (1 year ago)
- Files:
-
- branches/freewrt_1_0 (modified) (1 prop)
- branches/freewrt_1_0/Makefile (modified) (3 diffs)
- branches/freewrt_1_0/mk/build.mk (modified) (1 diff)
- branches/freewrt_1_0/package/config/Makefile (modified) (1 diff)
- branches/freewrt_1_0/scripts/param.h (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/Makefile (modified) (1 diff)
- branches/freewrt_1_0/tools/paxmirabilis/src/Makefile (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/ar_io.c (modified) (16 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/ar_subs.c (modified) (3 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/buf_subs.c (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/cache.c (modified) (7 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/cpio.1 (modified) (4 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/cpio.c (modified) (11 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/extern.h (modified) (7 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/ftree.c (modified) (3 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/gen_subs.c (modified) (4 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/getoldopt.c (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/options.c (modified) (23 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/pat_rep.c (modified) (5 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/pax.1 (modified) (8 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/pax.c (modified) (8 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/pax.h (modified) (4 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/sel_subs.c (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/tables.c (modified) (6 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/tar.1 (modified) (3 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/tar.c (modified) (7 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/src/tty_subs.c (modified) (2 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/strlfun.c (modified) (3 diffs)
- branches/freewrt_1_0/tools/paxmirabilis/strmode.c (modified) (1 diff)
- trunk/freewrt (modified) (1 prop)
- trunk/freewrt/Makefile (modified) (3 diffs)
- trunk/freewrt/mk/build.mk (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/freewrt_1_0
- Property svn:ignore changed from
.config*
.prereq_done
.tmpconfig.h
bin
build_*
dl
lbin
make.log
root_fs*
staging_dir_*
toolchain_build_*
tools_build
to
.config*
.prereq_done
.tmpconfig.h
_pax*
bin
build_*
dl
freewrt.tar.bz2
freewrt.tar.gz
lbin
make.log
root_fs*
staging_dir_*
toolchain_build_*
tools_build
- Property svn:ignore changed from
branches/freewrt_1_0/Makefile
r2383 r2715 34 34 @echo ' (default if .config exists)' 35 35 @echo ' v - Same as "all" but with logging to make.log enabled' 36 @echo ' targz|tarbz2 - Create a distribution tarball (runs distclean)' 36 37 37 38 … … 57 58 @${GMAKE_INV} distclean 58 59 @-rm -rf lbin 59 @-rm -f make.log .prereq_done 60 @-rm -f make.log .prereq_done _pax* freewrt.tar.* 60 61 61 62 image_clean: .prereq_done … … 162 163 @touch $@ 163 164 164 .PHONY: prereq prereq-noerror 165 _tarball: .prereq_done 166 @rm -f _pax* 167 @${GMAKE_INV} tools/paxmirabilis-compile 168 @install -c -m 555 tools_build/paxmirabilis/pax _pax 169 @${GMAKE_INV} distclean 170 @-rm -rf lbin 171 @-rm -f make.log .prereq_done freewrt.tar.* 172 @find . | \ 173 grep -v -e '^\.$$' -e '^\./_pax' -e '/\.svn' | \ 174 sed -e 's^\./' | \ 175 sort >_pax.flst 176 177 targz: _tarball 178 @./_pax -w -b 512 -d -M dist -P -t -v -x ustar <_pax.flst | \ 179 gzip -n9 >freewrt.tar.gz 180 @rm -f _pax* 181 182 tarbgz2: _tarball 183 @./_pax -w -b 512 -d -M dist -P -t -v -x ustar <_pax.flst | \ 184 bzip2 --best >freewrt.tar.bz2 185 @rm -f _pax* 186 187 .PHONY: prereq prereq-noerror _tarball targz tarbz2 branches/freewrt_1_0/mk/build.mk
r1625 r2715 140 140 scripts/restore-defaultconf.sh $(RESTORE_PATTERNS) 141 141 142 tools/install-lbin: 143 $(MAKE) -C tools install-lbin 142 tools/%: 143 @$(MAKE) -C tools $(patsubst tools/%,%,$@) 144 145 distclean: 146 @$(MAKE) -C $(CONFIG) clean 147 @rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR) 148 @rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR) 149 @rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR) 150 @rm -rf staging_dir_ tools_build 151 @rm -f .config* .tmpconfig.h 144 152 145 153 endif # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y) branches/freewrt_1_0/package/config/Makefile
r1089 r2715 114 114 115 115 clean: 116 rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \116 @rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \ 117 117 conf mconf zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h branches/freewrt_1_0/scripts/param.h
r223 r2715 1 1 /* $FreeWRT$ */ 2 3 /*- 4 * Copyright (c) 2007 5 * Thorsten Glaser <tg@mirbsd.de> 6 * 7 * Provided that these terms and disclaimer and all copyright notices 8 * are retained or reproduced in an accompanying document, permission 9 * is granted to deal in this work without restriction, including un- 10 * limited rights to use, publicly perform, distribute, sell, modify, 11 * merge, give away, or sublicence. 12 * 13 * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to 14 * the utmost extent permitted by applicable law, neither express nor 15 * implied; without malicious intent or gross negligence. In no event 16 * may a licensor, author or contributor be held liable for indirect, 17 * direct, other damage, loss, or other issues arising in any way out 18 * of dealing in the work, even if advised of the possibility of such 19 * damage or existence of a defect, except proven that it results out 20 * of said person's immediate fault when using the work as intended. 21 */ 2 22 3 23 #include_next </usr/include/sys/param.h> … … 7 27 #endif 8 28 9 #ifndef __SCCSID 10 #define __SCCSID(x) static const char __sccsid[] __attribute__((used)) = (x) 11 #endif 12 13 #ifndef __RCSID 14 #define __RCSID(x) static const char __rcsid[] __attribute__((used)) = (x) 29 #if !defined(__RCSID) || !defined(__SCCSID) || !defined(__COPYRIGHT) 30 #undef __IDSTRING 31 #undef __IDSTRING_CONCAT 32 #undef __IDSTRING_EXPAND 33 #undef __COPYRIGHT 34 #undef __RCSID 35 #undef __SCCSID 36 #define __IDSTRING_CONCAT(l,p) __LINTED__ ## l ## _ ## p 37 #define __IDSTRING_EXPAND(l,p) __IDSTRING_CONCAT(l,p) 38 #define __IDSTRING(prefix, string) \ 39 static const char __IDSTRING_EXPAND(__LINE__,prefix) [] \ 40 __attribute__((used)) = "@(""#)" #prefix ": " string 41 #define __COPYRIGHT(x) __IDSTRING(copyright,x) 42 #define __RCSID(x) __IDSTRING(rcsid,x) 43 #define __SCCSID(x) __IDSTRING(sccsid,x) 15 44 #endif 16 45 branches/freewrt_1_0/tools/paxmirabilis/Makefile
r533 r2715 1 1 # $FreeWRT$ 2 #- 3 # This file is part of the FreeWRT project. FreeWRT is copyrighted 4 # material, please see the LICENCE file in the top-level directory 5 # or at http://www.freewrt.org/licence for details. 2 6 3 7 include $(TOPDIR)/rules.mk branches/freewrt_1_0/tools/paxmirabilis/src/Makefile
r225 r2715 1 # $MirOS: src/bin/pax/Makefile,v 1. 3 2006/07/16 17:55:17tg Exp $1 # $MirOS: src/bin/pax/Makefile,v 1.4 2006/08/18 18:21:36 tg Exp $ 2 2 # $OpenBSD: Makefile,v 1.10 2001/05/26 00:32:20 millert Exp $ 3 3 … … 20 20 LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio 21 21 22 .if (${ OStype} == "Interix") || (${OStype} == "Linux")22 .if (${MACHINE_OS} == "Interix") || (${MACHINE_OS} == "Linux") 23 23 CPPFLAGS+= -DLONG_OFF_T 24 24 .endif branches/freewrt_1_0/tools/paxmirabilis/src/ar_io.c
r204 r2715 1 /** $MirOS: src/bin/pax/ar_io.c,v 1. 6 2006/06/23 23:03:55tg Exp $ */1 /** $MirOS: src/bin/pax/ar_io.c,v 1.8 2007/02/17 04:52:39 tg Exp $ */ 2 2 /* $OpenBSD: ar_io.c,v 1.37 2005/08/04 10:02:44 mpf Exp $ */ 3 3 /* $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $ */ … … 36 36 */ 37 37 38 #include <sys/ types.h>38 #include <sys/param.h> 39 39 #include <sys/time.h> 40 40 #include <sys/stat.h> … … 43 43 #include <sys/mtio.h> 44 44 #endif 45 #include <sys/param.h>46 45 #include <sys/wait.h> 47 46 #include <signal.h> … … 58 57 59 58 __SCCSID("@(#)ar_io.c 8.2 (Berkeley) 4/18/94"); 60 __RCSID("$MirOS: src/bin/pax/ar_io.c,v 1. 6 2006/06/23 23:03:55tg Exp $");59 __RCSID("$MirOS: src/bin/pax/ar_io.c,v 1.8 2007/02/17 04:52:39 tg Exp $"); 61 60 62 61 /* … … 82 81 static int can_unlnk = 0; /* do we unlink null archives? */ 83 82 const char *arcname; /* printable name of archive */ 83 static char *arcname_; /* this is so we can free(3) it */ 84 84 const char *gzip_program; /* name of gzip program */ 85 85 static pid_t zpid = -1; /* pid of child process */ 86 86 int force_one_volume; /* 1 if we ignore volume changes */ 87 87 88 #ifndef __INTERIX 88 89 static int get_phys(void); 90 #endif 89 91 extern sigset_t s_mask; 90 static void ar_start_gzip(int, const char *,int);92 static void ar_start_gzip(int, int); 91 93 92 94 /* … … 125 127 syswarn(1, errno, "Failed open to read on %s", name); 126 128 if (arfd != -1 && gzip_program != NULL) 127 ar_start_gzip(arfd, gzip_program,0);129 ar_start_gzip(arfd, 0); 128 130 break; 129 131 case ARCHIVE: … … 136 138 can_unlnk = 1; 137 139 if (arfd != -1 && gzip_program != NULL) 138 ar_start_gzip(arfd, gzip_program,1);140 ar_start_gzip(arfd, 1); 139 141 break; 140 142 case APPND: … … 396 398 (void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n", 397 399 # else 398 (void)fprintf(listf, "%s: unknown format, % qu bytes skipped.\n",400 (void)fprintf(listf, "%s: unknown format, %llu bytes skipped.\n", 399 401 # endif 400 402 argv0, rdcnt); … … 408 410 (void)fprintf(listf, "%lu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120); 409 411 # else 410 (void)fprintf(listf, "% qu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120);412 (void)fprintf(listf, "%llu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120); 411 413 # endif 412 414 else if (strcmp(NM_TAR, argv0) != 0) … … 415 417 "%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n", 416 418 # else 417 "%s: %s vol %d, %lu files, % qu bytes read, %qu bytes written.\n",419 "%s: %s vol %d, %lu files, %llu bytes read, %llu bytes written.\n", 418 420 # endif 419 421 argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt); … … 998 1000 } 999 1001 1002 #ifndef __INTERIX 1000 1003 /* 1001 1004 * get_phys() … … 1012 1015 get_phys(void) 1013 1016 { 1014 #ifndef __INTERIX1015 1017 int padsz = 0; 1016 1018 int res; … … 1111 1113 } 1112 1114 return(phyblk); 1113 #else 1114 return 0; 1115 } 1115 1116 #endif 1116 }1117 1117 1118 1118 /* … … 1249 1249 if (ar_open(buf) >= 0) { 1250 1250 if (freeit) { 1251 (void)free((char *)arcname);1251 free(arcname_); 1252 1252 freeit = 0; 1253 1253 } 1254 if ((arcname = strdup(buf)) == NULL) {1254 if ((arcname = arcname_ = strdup(buf)) == NULL) { 1255 1255 done = 1; 1256 1256 lstrval = -1; … … 1273 1273 */ 1274 1274 void 1275 ar_start_gzip(int fd, const char *gzip_program,int wr)1275 ar_start_gzip(int fd, int wr) 1276 1276 { 1277 1277 int fds[2]; … … 1304 1304 close(fds[0]); 1305 1305 close(fds[1]); 1306 if (execlp(gzip_program, gzip_program, gzip_flags, (char *)NULL) < 0)1306 if (execlp(gzip_program, gzip_program, gzip_flags, NULL) < 0) 1307 1307 err(1, "could not exec"); 1308 1308 /* NOTREACHED */ branches/freewrt_1_0/tools/paxmirabilis/src/ar_subs.c
r207 r2715 1 /** $MirOS: src/bin/pax/ar_subs.c,v 1. 4 2006/07/16 16:14:50tg Exp $ */1 /** $MirOS: src/bin/pax/ar_subs.c,v 1.5 2007/02/17 04:52:39 tg Exp $ */ 2 2 /* $OpenBSD: ar_subs.c,v 1.29 2006/01/25 17:42:08 markus Exp $ */ 3 3 /* $NetBSD: ar_subs.c,v 1.5 1995/03/21 09:07:06 cgd Exp $ */ … … 51 51 52 52 __SCCSID("@(#)ar_subs.c 8.2 (Berkeley) 4/18/94"); 53 __RCSID("$MirOS: src/bin/pax/ar_subs.c,v 1. 4 2006/07/16 16:14:50tg Exp $");53 __RCSID("$MirOS: src/bin/pax/ar_subs.c,v 1.5 2007/02/17 04:52:39 tg Exp $"); 54 54 55 55 static void wr_archive(ARCHD *, int is_app); … … 760 760 int fddest; 761 761 char *dest_pt; 762 int dlen;763 int drem;762 size_t dlen; 763 size_t drem; 764 764 int fdsrc = -1; 765 765 struct stat sb; branches/freewrt_1_0/tools/paxmirabilis/src/buf_subs.c
r204 r2715 35 35 */ 36 36 37 #ifndef lint 38 #if 0 39 static const char sccsid[] = "@(#)buf_subs.c 8.2 (Berkeley) 4/18/94"; 40 #else 41 static const char rcsid[] = "$OpenBSD: buf_subs.c,v 1.21 2005/11/09 19:59:06 otto Exp $"; 42 #endif 43 #endif /* not lint */ 44 45 #include <sys/types.h> 37 #include <sys/param.h> 46 38 #include <sys/time.h> 47 39 #include <sys/stat.h> 48 #include <sys/param.h>49 40 #include <stdio.h> 50 41 #include <errno.h> … … 54 45 #include "pax.h" 55 46 #include "extern.h" 47 48 __SCCSID("@(#)buf_subs.c 8.2 (Berkeley) 4/18/94"); 49 __RCSID("$MirOS: src/bin/pax/buf_subs.c,v 1.2 2007/02/17 04:52:40 tg Exp $"); 56 50 57 51 /* branches/freewrt_1_0/tools/paxmirabilis/src/cache.c
r225 r2715 1 /** $MirOS: src/bin/pax/cache.c,v 1. 3 2006/07/16 17:55:18tg Exp $ */1 /** $MirOS: src/bin/pax/cache.c,v 1.4 2007/02/17 04:52:40 tg Exp $ */ 2 2 /* $OpenBSD: cache.c,v 1.17 2004/03/16 03:28:34 tedu Exp $ */ 3 3 /* $NetBSD: cache.c,v 1.4 1995/03/21 09:07:10 cgd Exp $ */ … … 36 36 */ 37 37 38 #include <sys/ types.h>38 #include <sys/param.h> 39 39 #include <sys/time.h> 40 40 #include <sys/stat.h> 41 #include <sys/param.h>42 41 #include <string.h> 43 42 #include <stdio.h> … … 51 50 52 51 __SCCSID("@(#)cache.c 8.1 (Berkeley) 5/31/93"); 53 __RCSID("$MirOS: src/bin/pax/cache.c,v 1. 3 2006/07/16 17:55:18tg Exp $");52 __RCSID("$MirOS: src/bin/pax/cache.c,v 1.4 2007/02/17 04:52:40 tg Exp $"); 54 53 55 54 /* … … 171 170 */ 172 171 173 c har *172 const char * 174 173 name_uid(uid_t uid, int frc) 175 174 { … … 239 238 */ 240 239 241 c har *240 const char * 242 241 name_gid(gid_t gid, int frc) 243 242 { … … 307 306 308 307 int 309 uid_name(c har *name, uid_t *uid)308 uid_name(const char *name, uid_t *uid) 310 309 { 311 310 struct passwd *pw; … … 372 371 373 372 int 374 gid_name(c har *name, gid_t *gid)373 gid_name(const char *name, gid_t *gid) 375 374 { 376 375 struct group *gr; branches/freewrt_1_0/tools/paxmirabilis/src/cpio.1
r204 r2715 1 .\" $MirOS: src/bin/pax/cpio.1,v 1.1 4 2006/06/23 23:16:55tg Exp $1 .\" $MirOS: src/bin/pax/cpio.1,v 1.15 2006/07/21 17:34:59 tg Exp $ 2 2 .\" $OpenBSD: cpio.1,v 1.23 2006/01/03 17:22:47 jmc Exp $ 3 3 .\" … … 26 26 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 .\" 28 .Dd Ju ne 24, 200628 .Dd July 21, 2006 29 29 .Dt CPIO 1 30 .Os 30 .Os MirBSD 31 .\" for portability 32 .de Mx 33 .nr cF \\n(.f 34 .nr cZ \\n(.s 35 .ds aa \&\f\\n(cF\s\\n(cZ 36 .if \\n(aC==0 \{\ 37 . ie \\n(.$==0 \&MirOS\\*(aa 38 . el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 39 .\} 40 .if \\n(aC>\\n(aP \{\ 41 . nr aP \\n(aP+1 42 . ie \\n(C\\n(aP==2 \{\ 43 . as b1 \&MirOS\ #\&\\*(A\\n(aP\\*(aa 44 . ie \\n(aC>\\n(aP \{\ 45 . nr aP \\n(aP+1 46 . nR 47 . \} 48 . el .aZ 49 . \} 50 . el \{\ 51 . as b1 \&MirOS\\*(aa 52 . nR 53 . \} 54 .\} 55 .. 31 56 .Sh NAME 32 57 .Nm cpio … … 166 191 .Pp 167 192 This option is only implemented for the cpio, sv4cpio, 168 ustar, and sv4crcfile format writing routines.193 sv4crc, and ustar file format writing routines. 169 194 For the ustar format, the 170 195 .Ar inodes … … 381 406 The 382 407 .Fl M 383 option is a Mir OSextensions, available starting with408 option is a MirBSD extensions, available starting with 384 409 .Mx 8 . 385 410 Archives written using these options are, however, compatible to branches/freewrt_1_0/tools/paxmirabilis/src/cpio.c
r204 r2715 1 /** $MirOS: src/bin/pax/cpio.c,v 1.1 0 2006/06/19 19:22:08tg Exp $ */1 /** $MirOS: src/bin/pax/cpio.c,v 1.12 2007/02/17 05:07:12 tg Exp $ */ 2 2 /* $OpenBSD: cpio.c,v 1.17 2004/04/16 22:50:23 deraadt Exp $ */ 3 3 /* $NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $ */ … … 50 50 51 51 __SCCSID("@(#)cpio.c 8.1 (Berkeley) 5/31/93"); 52 __RCSID("$MirOS: src/bin/pax/cpio.c,v 1.1 0 2006/06/19 19:22:08tg Exp $");52 __RCSID("$MirOS: src/bin/pax/cpio.c,v 1.12 2007/02/17 05:07:12 tg Exp $"); 53 53 54 54 static int rd_nm(ARCHD *, int); … … 90 90 91 91 int 92 cpio_trail(ARCHD *arcn, char *notused, int notused2, int *notused3) 92 cpio_trail(ARCHD *arcn, char *notused __attribute__((unused)), 93 int notused2 __attribute__((unused)), 94 int *notused3 __attribute__((unused))) 93 95 { 94 96 /* … … 185 187 * do not even try bogus values 186 188 */ 187 if ((nsz == 0) || ( nsz > sizeof(arcn->name))) {189 if ((nsz == 0) || ((size_t)nsz > sizeof(arcn->name))) { 188 190 paxwarn(1, "Cpio file name length %d is out of range", nsz); 189 191 return(-1); … … 216 218 */ 217 219 if ((arcn->sb.st_size == 0) || 218 ( arcn->sb.st_size >= sizeof(arcn->ln_name))) {220 ((size_t)arcn->sb.st_size >= sizeof(arcn->ln_name))) { 219 221 # ifdef LONG_OFF_T 220 222 paxwarn(1, "Cpio link name length is invalid: %lu", 221 223 arcn->sb.st_size); 222 224 # else 223 paxwarn(1, "Cpio link name length is invalid: % qu",225 paxwarn(1, "Cpio link name length is invalid: %llu", 224 226 arcn->sb.st_size); 225 227 # endif … … 263 265 cpio_id(char *blk, int size) 264 266 { 265 if (( size < sizeof(HD_CPIO)) ||267 if (((size_t)size < sizeof(HD_CPIO)) || 266 268 (strncmp(blk, AMAGIC, sizeof(AMAGIC) - 1) != 0)) 267 269 return(-1); … … 418 420 t_gid = (anonarch & ANON_UIDGID) ? 0UL : (u_long)arcn->sb.st_gid; 419 421 t_mtime = (anonarch & ANON_MTIME) ? 0UL : (u_long)arcn->sb.st_mtime; 420 t_ino = (anonarch & ANON_INODES) ? chk_flnk(arcn) : arcn->sb.st_ino; 422 t_ino = (anonarch & ANON_INODES) ? (ino_t)chk_flnk(arcn) : 423 arcn->sb.st_ino; 421 424 t_dev = (anonarch & ANON_INODES) ? 0UL : (u_long)arcn->sb.st_dev; 422 425 if (!cpio_trail(arcn, NULL, 0, NULL)) 423 426 t_ino = 0UL; 424 if (t_ino == -1) {427 if (t_ino == (ino_t)-1) { 425 428 paxwarn(1, "Invalid inode number for file %s", arcn->org_name); 426 429 return (1); … … 553 556 vcpio_id(char *blk, int size) 554 557 { 555 if (( size < sizeof(HD_VCPIO)) ||558 if (((size_t)size < sizeof(HD_VCPIO)) || 556 559 (strncmp(blk, AVMAGIC, sizeof(AVMAGIC) - 1) != 0)) 557 560 return(-1); … … 570 573 crc_id(char *blk, int size) 571 574 { 572 if (( size < sizeof(HD_VCPIO)) ||575 if (((size_t)size < sizeof(HD_VCPIO)) || 573 576 (strncmp(blk, AVCMAGIC, sizeof(AVCMAGIC) - 1) != 0)) 574 577 return(-1); … … 788 791 t_gid = (anonarch & ANON_UIDGID) ? 0UL : (u_long)arcn->sb.st_gid; 789 792 t_mtime = (anonarch & ANON_MTIME) ? 0UL : (u_long)arcn->sb.st_mtime; 790 t_ino = (anonarch & ANON_INODES) ? chk_flnk(arcn) : arcn->sb.st_ino; 793 t_ino = (anonarch & ANON_INODES) ? (ino_t)chk_flnk(arcn) : 794 arcn->sb.st_ino; 791 795 t_major = (anonarch & ANON_INODES) ? 0UL : (u_long)MAJOR(arcn->sb.st_dev); 792 796 t_minor = (anonarch & ANON_INODES) ? 0UL : (u_long)MINOR(arcn->sb.st_dev); 793 797 if (!cpio_trail(arcn, NULL, 0, NULL)) 794 798 t_ino = 0UL; 795 if (t_ino == -1) {799 if (t_ino == (ino_t)-1) { 796 800 paxwarn(1, "Invalid inode number for file %s", arcn->org_name); 797 801 return (1); … … 939 943 bcpio_id(char *blk, int size) 940 944 { 941 if ( size < sizeof(HD_BCPIO))945 if ((size_t)size < sizeof(HD_BCPIO)) 942 946 return(-1); 943 947 branches/freewrt_1_0/tools/paxmirabilis/src/extern.h
r2051 r2715 1 /** $MirOS: src/bin/pax/extern.h,v 1. 7 2006/07/16 17:56:29tg Exp $ */1 /** $MirOS: src/bin/pax/extern.h,v 1.9 2007/02/17 04:52:40 tg Exp $ */ 2 2 /* $OpenBSD: extern.h,v 1.31 2005/04/28 06:58:07 otto Exp $ */ 3 3 /* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */ … … 47 47 #endif 48 48 49 /* compatibility hack */50 #ifndef __GLIBC_PREREQ51 #define __GLIBC_PREREQ(x,y) 052 #endif53 54 49 /* 55 50 * ar_io.c … … 114 109 int usrtb_start(void); 115 110 int grptb_start(void); 116 c har *name_uid(uid_t, int);117 c har *name_gid(gid_t, int);118 int uid_name(c har *, uid_t *);119 int gid_name(c har *, gid_t *);111 const char *name_uid(uid_t, int); 112 const char *name_gid(gid_t, int); 113 int uid_name(const char *, uid_t *); 114 int gid_name(const char *, gid_t *); 120 115 121 116 /* … … 251 246 extern char *dirptr; 252 247 extern char *ltmfrmt; 253 extern c har *argv0;248 extern const char *argv0; 254 249 extern FILE *listf; 255 250 extern char *tempfile; … … 257 252 258 253 int main(int, char **); 259 void sig_cleanup(int);260 254 261 255 /* … … 289 283 void add_dir(char *, struct stat *, int); 290 284 void proc_dir(void); 291 u_int st_hash(c har *, int, int);285 u_int st_hash(const char *, int, int); 292 286 int flnk_start(void); 293 287 int chk_flnk(ARCHD *); … … 314 308 */ 315 309 int tty_init(void); 316 void tty_prnt(const char *, ...); 310 void tty_prnt(const char *, ...) 311 __attribute__((format (printf, 1, 2))); 317 312 int tty_read(char *, int); 318 void paxwarn(int, const char *, ...); 319 void syswarn(int, int, const char *, ...); 313 void paxwarn(int, const char *, ...) 314 __attribute__((format (printf, 2, 3))); 315 void syswarn(int, int, const char *, ...) 316 __attribute__((format (printf, 3, 4))); branches/freewrt_1_0/tools/paxmirabilis/src/ftree.c
r204 r2715 35 35 */ 36 36 37 #ifndef lint 38 #if 0 39 static const char sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94"; 40 #else 41 static const char rcsid[] = "$OpenBSD: ftree.c,v 1.26 2005/04/21 21:47:18 beck Exp $"; 42 #endif 43 #endif /* not lint */ 44 45 #include <sys/types.h> 37 #include <sys/param.h> 46 38 #include <sys/time.h> 47 39 #include <sys/stat.h> 48 #include <sys/param.h>49 40 #include <unistd.h> 50 41 #include <string.h> … … 56 47 #include "ftree.h" 57 48 #include "extern.h" 49 50 __SCCSID("@(#)ftree.c 8.2 (Berkeley) 4/18/94"); 51 __RCSID("$MirOS: src/bin/pax/ftree.c,v 1.2 2007/02/17 04:52:40 tg Exp $"); 58 52 59 53 /* … … 495 489 */ 496 490 arcn->nlen = strlcpy(arcn->name, ftent->fts_path, sizeof(arcn->name)); 497 if ( arcn->nlen >= sizeof(arcn->name))491 if ((size_t)arcn->nlen >= sizeof(arcn->name)) 498 492 arcn->nlen = sizeof(arcn->name) - 1; /* XXX truncate? */ 499 493 arcn->org_name = ftent->fts_path; branches/freewrt_1_0/tools/paxmirabilis/src/gen_subs.c
r225 r2715 1 /** $MirOS: src/bin/pax/gen_subs.c,v 1. 6 2006/07/16 17:58:08tg Exp $ */1 /** $MirOS: src/bin/pax/gen_subs.c,v 1.7 2007/02/17 04:52:40 tg Exp $ */ 2 2 /* $OpenBSD: gen_subs.c,v 1.18 2005/04/28 06:58:07 otto Exp $ */ 3 3 /* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */ … … 36 36 */ 37 37 38 #include <sys/ types.h>38 #include <sys/param.h> 39 39 #include <sys/time.h> 40 40 #include <sys/stat.h> 41 #include <sys/param.h>42 41 #include <stdio.h> 43 42 #include <tzfile.h> … … 57 56 58 57 __SCCSID("@(#)gen_subs.c 8.1 (Berkeley) 5/31/93"); 59 __RCSID("$MirOS: src/bin/pax/gen_subs.c,v 1. 6 2006/07/16 17:58:08tg Exp $");58 __RCSID("$MirOS: src/bin/pax/gen_subs.c,v 1.7 2007/02/17 04:52:40 tg Exp $"); 60 59 61 60 #ifdef __GLIBC__ … … 144 143 (void)fprintf(fp, "%9lu ", sbp->st_size); 145 144 # else 146 (void)fprintf(fp, "%9 qu ", sbp->st_size);145 (void)fprintf(fp, "%9llu ", sbp->st_size); 147 146 # endif 148 147 } branches/freewrt_1_0/tools/paxmirabilis/src/getoldopt.c
r204 r2715 11 11 */ 12 12 13 #ifndef lint14 static const char rcsid[] = "$OpenBSD: getoldopt.c,v 1.8 2003/07/02 21:19:33 deraadt Exp $";15 #endif /* not lint */16 17 13 #include <sys/types.h> 18 14 #include <sys/stat.h> … … 22 18 #include "pax.h" 23 19 #include "extern.h" 20 21 __RCSID("$MirOS: src/bin/pax/getoldopt.c,v 1.2 2007/02/17 04:52:40 tg Exp $"); 24 22 25 23 int branches/freewrt_1_0/tools/paxmirabilis/src/options.c
r225 r2715 1 /** $MirOS: src/bin/pax/options.c,v 1. 19 2006/07/16 17:58:39tg Exp $ */1 /** $MirOS: src/bin/pax/options.c,v 1.24 2007/02/17 04:52:41 tg Exp $ */ 2 2 /* $OpenBSD: options.c,v 1.64 2006/04/09 03:35:34 jaredy Exp $ */ 3 3 /* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */ 4 4 5 5 /*- 6 * Copyright (c) 2005, 2006 Thorsten Glaser <tg@66h.42h.de>6 * Copyright (c) 2005, 2006, 2007 Thorsten Glaser <tg@66h.42h.de> 7 7 * Copyright (c) 1992 Keith Muller. 8 8 * Copyright (c) 1992, 1993 … … 58 58 59 59 __SCCSID("@(#)options.c 8.2 (Berkeley) 4/18/94"); 60 __RCSID("$MirOS: src/bin/pax/options.c,v 1. 19 2006/07/16 17:58:39tg Exp $");60 __RCSID("$MirOS: src/bin/pax/options.c,v 1.24 2007/02/17 04:52:41 tg Exp $"); 61 61 62 62 #ifdef __GLIBC__ … … 78 78 static char *getline(FILE *fp); 79 79 static void pax_options(int, char **); 80 static void pax_usage(void); 80 static void pax_usage(void) __attribute__((noreturn)); 81 static void tar_set_action(int); 81 82 static void tar_options(int, char **); 82 static void tar_usage(void); 83 static void tar_usage(void) __attribute__((noreturn)); 84 static void cpio_set_action(int); 83 85 static void cpio_options(int, char **); 84 static void cpio_usage(void) ;86 static void cpio_usage(void) __attribute__((noreturn)); 85 87 int mkpath(char *); 86 88 … … 214 216 { 215 217 int c; 216 int i;218 size_t i; 217 219 unsigned int flg = 0; 218 220 unsigned int bflg = 0; … … 223 225 * process option flags 224 226 */ 225 while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HL OPT:U:XYZ0"))227 while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLM:OPT:U:XYZ0")) 226 228 != -1) { 227 229 switch (c) { … … 476 478 flg |= CLF; 477 479 break; 480 case 'M': 481 /* 482 * MirOS extension: archive normaliser 483 */ 484 process_M(optarg, pax_usage); 485 break; 478 486 case 'O': 479 487 /* … … 623 631 624 632 static void 633 tar_set_action(int op) 634 { 635 if (act != ERROR && act != op) 636 tar_usage(); 637 act = op; 638 } 639 640 static void 625 641 tar_options(int argc, char **argv) 626 642 { … … 661 677 * create an archive 662 678 */ 663 act = ARCHIVE;679 tar_set_action(ARCHIVE); 664 680 break; 665 681 case 'e': … … 721 737 * append to the archive 722 738 */ 723 act = APPND;739 tar_set_action(APPND); 724 740 break; 725 741 case 'R': … … 744 760 * list contents of the tape 745 761 */ 746 act = LIST;762 tar_set_action(LIST); 747 763 break; 748 764 case 'v': … … 763 779 * and mtime if possible. 764 780 */ 765 act = EXTRACT;781 tar_set_action(EXTRACT); 766 782 pmtime = 1; 767 783 break; … … 852 868 argc -= optind; 853 869 argv += optind; 870 871 /* Tar requires an action. */ 872 if (act == ERROR) 873 tar_usage(); 854 874 855 875 /* Traditional tar behaviour (pax uses stderr unless in list mode) */ … … 1070 1090 return (0); 1071 1091 } 1092 1093 static void 1094 cpio_set_action(int op) 1095 { 1096 if ((act == APPND && op == ARCHIVE) || (act == ARCHIVE && op == APPND)) 1097 act = APPND; 1098 else if ((act == LIST && op == EXTRACT) || (act == EXTRACT && op == LIST)) 1099 act = LIST; 1100 else if (act != ERROR && act != op) 1101 cpio_usage(); 1102 else 1103 act = op; 1104 } 1105 1072 1106 /* 1073 1107 * cpio_options() … … 1079 1113 cpio_options(int argc, char **argv) 1080 1114 { 1081 int c, i; 1115 int c; 1116 size_t i; 1082 1117 char *str; 1083 1118 FSUB tmp; … … 1090 1125 arcname = NULL; 1091 1126 dflag = 1; 1092 act = -1;1093 1127 nodirs = 1; 1094 1128 while ((c=getopt(argc,argv,"abcdfiklmoprstuvzABC:E:F:H:I:LM:O:SZ6")) != -1) … … 1127 1161 * restore an archive 1128 1162 */ 1129 act = EXTRACT;1163 cpio_set_action(EXTRACT); 1130 1164 break; 1131 1165 case 'k': … … 1147 1181 * create an archive 1148 1182 */ 1149 act = ARCHIVE;1183 cpio_set_action(ARCHIVE); 1150 1184 frmt = &(fsub[F_CPIO]); 1151 1185 break; … … 1154 1188  
