1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-14 23:46:10 +00:00
freebsd-ports/databases/msql3/files/patch-am
Thomas Gellekum 8c996bfeee Upgrade to 2.0.3; James seems to be busy at the moment.
PR:		4769
Submitted by:	Mikhail Teterin <mi@aldan.ziplink.net>
1998-02-13 10:54:49 +00:00

175 lines
5.2 KiB
Plaintext

--- src/msql/msqldb.c Fri Feb 7 10:06:42 1997
+++ src/msql/msqldb.c Fri Feb 7 10:15:22 1997
@@ -126,7 +126,7 @@
#endif
msqlTrace(TRACE_IN,"msqlListDBs()");
- (void)snprintf(path, MAXPATHLEN, "%s/msqldb",msqlHomeDir);
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb");
dirp = opendir(path);
if (!dirp)
{
@@ -187,7 +187,7 @@
#endif
msqlTrace(TRACE_IN,"msqlListTables()");
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s",msqlHomeDir,db);
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s",db);
dirp = opendir(path);
if (!dirp)
{
@@ -1130,7 +1130,7 @@
struct stat buf;
msqlTrace(TRACE_IN,"msqlInit()");
- (void)snprintf(path, MAXPATHLEN, "%s/msqldb/%s",msqlHomeDir,db);
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s",db);
if (stat(path,&buf) < 0)
{
snprintf(errMsg,BAD_DB_ERROR,db);
@@ -1165,8 +1165,7 @@
/*
** Write the catalog entry
*/
- (void)snprintf(defPath, MAXPATHLEN, "%s/msqldb/%s/%s.def",
- msqlHomeDir,db,table);
+ (void)snprintf(defPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.def",db,table);
#ifdef OS2
fd = _sopen(defPath,O_RDONLY,SH_DENYNO, S_IREAD | S_IWRITE);
#else
@@ -1239,8 +1239,7 @@
** Create an empty table
*/
- (void)snprintf(datPath,MAXPATHLEN, "%s/msqldb/%s/%s.dat",
- msqlHomeDir,db,table);
+ (void)snprintf(datPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.dat",db,table);
(void)unlink(datPath);
#ifdef OS2
fd = _sopen(datPath,O_CREAT | O_WRONLY | O_BINARY, SH_DENYNO,
@@ -1279,8 +1279,7 @@
** Create an empty index def file
*/
- (void)snprintf(idxPath, MAXPATHLEN, "%s/msqldb/%s/%s.idx",
- msqlHomeDir,db,table);
+ (void)snprintf(idxPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx",db,table);
(void)unlink(idxPath);
#ifdef OS2
fd = _sopen(idxPath,O_CREAT | O_WRONLY | O_BINARY, SH_DENYNO,
@@ -1302,8 +1302,7 @@
/*
** Create an empty overflow file
*/
- (void)snprintf(oflPath,MAXPATHLEN,"%s/msqldb/%s/%s.ofl",
- msqlHomeDir,db,table);
+ (void)snprintf(oflPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.ofl",db,table);
(void)unlink(oflPath);
#ifdef OS2
fd = _sopen(oflPath,O_CREAT | O_WRONLY | O_BINARY, SH_DENYNO,
@@ -1454,10 +1454,10 @@
/*
** Can't clash with another index either
*/
- (void)snprintf(defPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx",msqlHomeDir,
+ (void)snprintf(defPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx",
db, index->table);
- (void)snprintf(idxPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx-%s",
- msqlHomeDir,db, index->table, index->name);
+ (void)snprintf(idxPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx-%s",
+ db, index->table, index->name);
#ifdef OS2
@@ -1718,8 +1718,7 @@
/*
** Now blow away the table files
*/
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s/%s.def",msqlHomeDir,
- db,table);
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s/%s.def",db,table);
#ifdef OS2
fp = fopen(path, MAXPATHLEN, "rb");
#else
@@ -1733,18 +1733,15 @@
}
(void)fclose(fp);
unlink(path);
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s/%s.dat",msqlHomeDir,
- db,table);
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s/%s.dat",db,table);
unlink(path);
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s/%s.ofl",msqlHomeDir,
- db,table);
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s/%s.ofl",db,table);
unlink(path);
/*
** Take care of the index files.
*/
- (void)snprintf(defPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx",msqlHomeDir,
- db,table);
+ (void)snprintf(defPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx",db,table);
#ifdef OS2
fd = _sopen(defPath,O_RDONLY | O_BINARY, SH_DENYNO, S_IREAD | S_IWRITE);
#else
@@ -1751,9 +1751,9 @@
{
while(read(fd,&tmp,sizeof(tmp)) == sizeof(tmp))
{
- (void)snprintf(path,MAXPATHLEN,
- "%s/msqldb/%s/%s.idx-%s",
- msqlHomeDir,db,table,tmp.name);
+ (void)snprintf(path, MAXPATHLEN,
+ "/var/db/msqldb/%s/%s.idx-%s",
+ db,table,tmp.name);
unlink(path);
}
close(fd);
@@ -1791,7 +1791,7 @@
return(-1);
}
- (void)snprintf(defPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx",msqlHomeDir,
+ (void)snprintf(defPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx",
db, index->table);
#ifdef OS2
in = _sopen(defPath,O_RDONLY | O_BINARY, SH_DENYNO, S_IREAD | S_IWRITE);
@@ -1804,7 +1804,7 @@
msqlTrace(TRACE_OUT,"msqlDropIndex()");
return(-1);
}
- (void)snprintf(tmpPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx-tmp",
- msqlHomeDir,db, index->table);
+ (void)snprintf(tmpPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx-tmp",
+ db, index->table);
#ifdef OS2
out = _sopen(tmpPath,O_RDWR | O_CREAT | O_BINARY, SH_DENYNO,
@@ -1855,7 +1855,7 @@
*/
unlink(defPath);
rename(tmpPath,defPath);
- snprintf(tmpPath,MAXPATHLEN,"%s/msqldb/%s/%s.idx-%s",msqlHomeDir,db,
+ snprintf(tmpPath, MAXPATHLEN, "/var/db/msqldb/%s/%s.idx-%s",db,
index->table, index->name);
unlink(tmpPath);
@@ -2412,7 +2412,7 @@
** See if the directory exists
*/
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s", msqlHomeDir, db);
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s", db);
dirp = opendir(path);
if (dirp)
{
@@ -2459,7 +2459,7 @@
** See if the directory exists
*/
- (void)snprintf(path,MAXPATHLEN,"%s/msqldb/%s", msqlHomeDir, db);
+ (void)snprintf(path, MAXPATHLEN, "/var/db/msqldb/%s", db);
dirp = opendir(path);
if (!dirp)
{