English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Diff of /branches/freewrt_1_0/tools/paxmirabilis/src/tables.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3815 by tg, Tue Jun 5 14:52:44 2007 UTC revision 3816 by tg, Wed Oct 29 17:58:40 2008 UTC
# Line 1  Line 1 
1  /**     $MirOS: src/bin/pax/tables.c,v 1.7 2007/02/17 04:52:41 tg Exp $ */  /*      $OpenBSD: tables.c,v 1.25 2007/09/02 15:19:08 deraadt Exp $     */
 /*      $OpenBSD: tables.c,v 1.23 2005/04/21 21:47:18 beck Exp $        */  
2  /*      $NetBSD: tables.c,v 1.4 1995/03/21 09:07:45 cgd Exp $   */  /*      $NetBSD: tables.c,v 1.4 1995/03/21 09:07:45 cgd Exp $   */
3    
4  /*-  /*-
# Line 50  Line 49 
49  #include "extern.h"  #include "extern.h"
50    
51  __SCCSID("@(#)tables.c  8.1 (Berkeley) 5/31/93");  __SCCSID("@(#)tables.c  8.1 (Berkeley) 5/31/93");
52  __RCSID("$MirOS: src/bin/pax/tables.c,v 1.7 2007/02/17 04:52:41 tg Exp $");  __RCSID("$MirOS: src/bin/pax/tables.c,v 1.8 2007/10/23 20:07:42 tg Exp $");
53    
54  /*  /*
55   * Routines for controlling the contents of all the different databases pax   * Routines for controlling the contents of all the different databases pax
# Line 148  chk_lnk(ARCHD *arcn) Line 147  chk_lnk(ARCHD *arcn)
147          indx = ((unsigned)arcn->sb.st_ino) % L_TAB_SZ;          indx = ((unsigned)arcn->sb.st_ino) % L_TAB_SZ;
148          if ((pt = ltab[indx]) != NULL) {          if ((pt = ltab[indx]) != NULL) {
149                  /*                  /*
150                   * it's hash chain in not empty, walk down looking for it                   * its hash chain in not empty, walk down looking for it
151                   */                   */
152                  ppt = &(ltab[indx]);                  ppt = &(ltab[indx]);
153                  while (pt != NULL) {                  while (pt != NULL) {
# Line 1099  dir_start(void) Line 1098  dir_start(void)
1098                  return(0);                  return(0);
1099    
1100          dirsize = DIRP_SIZE;          dirsize = DIRP_SIZE;
1101          if ((dirp = malloc(dirsize * sizeof(DIRDATA))) == NULL) {          if ((dirp = calloc(dirsize, sizeof(DIRDATA))) == NULL) {
1102                  paxwarn(1, "Unable to allocate memory for directory times");                  paxwarn(1, "Unable to allocate memory for directory times");
1103                  return(-1);                  return(-1);
1104          }          }
# Line 1123  void Line 1122  void
1122  add_dir(char *name, struct stat *psb, int frc_mode)  add_dir(char *name, struct stat *psb, int frc_mode)
1123  {  {
1124          DIRDATA *dblk;          DIRDATA *dblk;
1125            char realname[MAXPATHLEN], *rp;
1126    
1127          if (dirp == NULL)          if (dirp == NULL)
1128                  return;                  return;
1129    
1130            if (havechd && *name != '/') {
1131                    if ((rp = realpath(name, realname)) == NULL) {
1132                            paxwarn(1, "Cannot canonicalize %s", name);
1133                            return;
1134                    }
1135                    name = rp;
1136            }
1137          if (dircnt == (long)dirsize) {          if (dircnt == (long)dirsize) {
1138                  dblk = realloc(dirp, 2 * dirsize * sizeof(DIRDATA));                  dblk = realloc(dirp, 2 * dirsize * sizeof(DIRDATA));
1139                  if (dblk == NULL) {                  if (dblk == NULL) {

Legend:
Removed from v.3815  
changed lines
  Added in v.3816

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20