BUGFIX: TDB.C and TDBTOOL.C from Jul 9th CVS snapshot.

John E. Malmberg malmberg at Encompasserve.org
Tue Jul 10 14:07:39 GMT 2001


The following changes were needed to get SAMBA 2.2.x Jul 9th CVS snapshot
to compile on OpenVMS 7.2-1 Alpha using Compaq C Version 6.4-005.

Note that this is just for compiling.  I still have a bit of work to do to
get it to actually run.

Compaq C is common to Tru-64 Unix, Linux on Alpha, and OpenVMS.

-----------------

TDB.C


OpenVMS needs the SMB_STRUCT_STAT to be used instead of struct stat on any
module that references st_ino.  On OpenVMS st_ino in struct stat is
unsigned short[3].

TDB_C.DIFF
************
File PROJECT_ROOT:[SAMBA_VMS.SOURCE.TDB]TDB.C;2
  233   /*	struct stat st; */
  234   	SMB_STRUCT_STAT st;
  235   	if (len <= tdb->map_size) return 0;
******
File PROJECT_ROOT:[SAMBA_VMS.SOURCE.TDB]TDB.C;1
  233   	struct stat st;
  234   	if (len <= tdb->map_size) return 0;
************
************
File PROJECT_ROOT:[SAMBA_VMS.SOURCE.TDB]TDB.C;2
 1258   /*	struct stat st; */
 1259   	SMB_STRUCT_STAT st;
 1260   	int rev = 0, locked;
******
File PROJECT_ROOT:[SAMBA_VMS.SOURCE.TDB]TDB.C;1
 1257   	struct stat st;
 1258   	int rev = 0, locked;
************

Number of difference sections found: 2
Number of difference records found: 4

DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=PROJECT_ROOT:[SAMBA_VMS.SOURCE]TDB_C.DIFF;1-
    PROJECT_ROOT:[SAMBA_VMS.SOURCE.TDB]TDB.C;2-
    PROJECT_ROOT:[SAMBA_VMS.SOURCE.TDB]TDB.C;1


-----------------


TDBTOOL.C

Compaq C can not deal with a string constant with imbedded new lines in
it.  Also (char *) and (unsigned char *) can not be mixed.

TDBTOOL_C.DIFF
************
File PROJECT_ROOT:[SAMBA_VMS.SOURCE]TDBTOOL.C;1
   81   	printf("
   82   tdbtool:
   83     create    dbname     : create a database
   84     open      dbname     : open an existing database
   85     erase                : erase the database
   86     dump                 : dump the database as strings
   87     insert    key  data  : insert a record
   88     store     key  data  : store a record (replace)
   89     show      key        : show a record by key
   90     delete    key        : delete a record by key
   91     free                 : print the database freelist
   92     1 | first            : print the first record
   93     n | next             : print the next record
   94     q | quit             : terminate
   95     \\n                   : repeat 'next' command
   96   ");
   97   }
******
File PROJECT_ROOT:[SAMBA_VMS.SOURCE.TDB]TDBTOOL.C;2
   81   	puts("\ntdbtool: ");
   82   puts("  create    dbname     : create a database");
   83   puts("  open      dbname     : open an existing database");
   84   puts("  erase                : erase the database");
   85   puts("  dump                 : dump the database as strings");
   86   puts("  insert    key  data  : insert a record");
   87   puts("  store     key  data  : store a record (replace)");
   88   puts("  show      key        : show a record by key");
   89   puts("  delete    key        : delete a record by key");
   90   puts("  free                 : print the database freelist");
   91   puts("  1 | first            : print the first record");
   92   puts("  n | next             : print the next record");
   93   puts("  q | quit             : terminate");
   94   puts("  \\n                   : repeat 'next' command\n");
   95   }
************
************
File PROJECT_ROOT:[SAMBA_VMS.SOURCE]TDBTOOL.C;1
  236   	print_data(key.dptr, key.dsize);
  237   	printf("data %d bytes\n", dbuf.dsize);
  238   	print_data(dbuf.dptr, dbuf.dsize);
  239   	return 0;
******
File PROJECT_ROOT:[SAMBA_VMS.SOURCE.TDB]TDBTOOL.C;2
  234   	print_data((unsigned char *)key.dptr, key.dsize);
  235   	printf("data %d bytes\n", dbuf.dsize);
  236   	print_data((unsigned char *)dbuf.dptr, dbuf.dsize);
  237   	return 0;
************

Number of difference sections found: 2
Number of difference records found: 19

DIFFERENCES /IGNORE=()/MERGED=1/OUTPUT=PROJECT_ROOT:[SAMBA_VMS.SOURCE]TDBTOOL_C.DIFF;1-
    PROJECT_ROOT:[SAMBA_VMS.SOURCE]TDBTOOL.C;1-
    PROJECT_ROOT:[SAMBA_VMS.SOURCE.TDB]TDBTOOL.C;2

-John
wb8tyw at qsl.network
Personal Opinion Only





More information about the samba-technical mailing list