/[man-db]/man-db/src/check_mandirs.c
ViewVC logotype

Diff of /man-db/src/check_mandirs.c

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

revision 1.43 by cjwatson, Mon Apr 28 14:12:43 2003 UTC revision 1.44 by cjwatson, Thu May 1 15:54:03 2003 UTC
# Line 429  void update_db_time (void) Line 429  void update_db_time (void)
429          datum key1, content1;          datum key1, content1;
430  #endif /* FAST_BTREE */  #endif /* FAST_BTREE */
431    
432          key.dptr = KEY;          key.dptr = xstrdup (KEY);
433          key.dsize = sizeof KEY;          key.dsize = sizeof KEY;
434          content.dptr = (char *) xmalloc (16); /* 11 is max long with '\0' */          content.dptr = (char *) xmalloc (16); /* 11 is max long with '\0' */
435          (void) sprintf (content.dptr, "%ld", (long) time (NULL));          (void) sprintf (content.dptr, "%ld", (long) time (NULL));
# Line 462  void update_db_time (void) Line 462  void update_db_time (void)
462  #endif /* !FAST_BTREE */  #endif /* !FAST_BTREE */
463    
464          MYDBM_CLOSE (dbf);          MYDBM_CLOSE (dbf);
465            free (key.dptr);
466          free (content.dptr);          free (content.dptr);
467  }  }
468    
# Line 471  void reset_db_time (void) Line 472  void reset_db_time (void)
472  {  {
473          datum key;          datum key;
474    
475          key.dptr = KEY;          key.dptr = xstrdup (KEY);
476          key.dsize = sizeof KEY;          key.dsize = sizeof KEY;
477    
478          /* we don't really care if we can't open it RW - it's not fatal */          /* we don't really care if we can't open it RW - it's not fatal */
# Line 488  void reset_db_time (void) Line 489  void reset_db_time (void)
489          if (debug)          if (debug)
490                  fprintf (stderr, "reset_db_time()\n");                  fprintf (stderr, "reset_db_time()\n");
491          MYDBM_CLOSE (dbf);          MYDBM_CLOSE (dbf);
492            free (key.dptr);
493  }  }
494    
495  /* routine to prepare/create the db prior to calling testmandirs() */  /* routine to prepare/create the db prior to calling testmandirs() */
# Line 540  short update_db (const char *manpath) Line 542  short update_db (const char *manpath)
542                  datum key, content;                  datum key, content;
543                  short new;                  short new;
544    
545                  key.dptr = KEY;                  key.dptr = xstrdup (KEY);
546                  key.dsize = sizeof KEY;                  key.dsize = sizeof KEY;
547                  content = MYDBM_FETCH (dbf, key);                  content = MYDBM_FETCH (dbf, key);
548                  MYDBM_CLOSE (dbf);                  MYDBM_CLOSE (dbf);
549                    free (key.dptr);
550    
551                  if (debug)                  if (debug)
552                          fprintf (stderr, "update_db(): %ld\n",                          fprintf (stderr, "update_db(): %ld\n",

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26