Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5eb2c03f
Commit
5eb2c03f
authored
Jul 31, 2003
by
wax@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/wax/mysql/mysql-4.0
into mysql.com:/home/wax/mysql/mysql-4.0chsize
parents
5c1ce3c1
99df703b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
16 deletions
+41
-16
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
include/config-win.h
include/config-win.h
+1
-0
mysys/my_chsize.c
mysys/my_chsize.c
+39
-16
No files found.
BitKeeper/etc/logging_ok
View file @
5eb2c03f
...
...
@@ -112,6 +112,7 @@ vva@eagle.mysql.r18.ru
vva@genie.(none)
walrus@kishkin.ru
walrus@mysql.com
wax@mysql.com
worm@altair.is.lan
zak@balfor.local
zak@linux.local
...
...
include/config-win.h
View file @
5eb2c03f
...
...
@@ -276,6 +276,7 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_ISAM
/* We want to have support for ISAM in 4.0 */
#define HAVE_QUERY_CACHE
#define SPRINTF_RETURNS_INT
#define HAVE_SETFILEPOINTER
/* SetFilePointer function for huge files */
#ifdef NOT_USED
#define HAVE_SNPRINTF
/* Gave link error */
...
...
mysys/my_chsize.c
View file @
5eb2c03f
...
...
@@ -36,24 +36,11 @@
0 Ok
1 Error
*/
int
my_chsize
(
File
fd
,
my_off_t
newlength
,
int
filler
,
myf
MyFlags
)
{
DBUG_ENTER
(
"my_chsize"
);
DBUG_PRINT
(
"my"
,(
"fd: %d length: %lu MyFlags: %d"
,
fd
,(
ulong
)
newlength
,
MyFlags
));
#ifdef HAVE_CHSIZE
if
(
chsize
(
fd
,(
off_t
)
newlength
))
{
DBUG_PRINT
(
"error"
,(
"errno: %d"
,
errno
));
my_errno
=
errno
;
if
(
MyFlags
&
MY_WME
)
my_error
(
EE_CANT_CHSIZE
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
errno
);
DBUG_RETURN
(
1
);
}
DBUG_RETURN
(
0
);
#else
/* if file is shorter, expand with null, else fill unused part with null */
{
my_off_t
oldsize
;
...
...
@@ -62,7 +49,42 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
oldsize
=
my_seek
(
fd
,
0L
,
MY_SEEK_END
,
MYF
(
MY_WME
+
MY_FAE
));
DBUG_PRINT
(
"info"
,(
"old_size: %ld"
,
(
ulong
)
oldsize
));
#ifdef HAVE_FTRUNCATE
#ifdef HAVE_CHSIZE
if
(
oldsize
>
newlength
||
filler
==
0
)
{
if
(
chsize
(
fd
,(
off_t
)
newlength
))
{
DBUG_PRINT
(
"error"
,(
"errno: %d"
,
errno
));
my_errno
=
errno
;
if
(
MyFlags
&
MY_WME
)
my_error
(
EE_CANT_CHSIZE
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
errno
);
DBUG_RETURN
(
1
);
}
else
{
if
(
filler
==
0
)
DBUG_RETURN
(
0
);
}
}
#elif defined(HAVE_SETFILEPOINTER)
if
(
oldsize
>
newlength
)
{
LARGE_INTEGER
new_length
;
HANDLE
win_file
;
win_file
=
(
HANDLE
)
_get_osfhandle
(
fd
);
new_length
.
QuadPart
=
newlength
;
if
(
SetFilePointerEx
(
win_file
,
new_length
,
NULL
,
FILE_BEGIN
))
{
if
(
SetEndOfFile
(
win_file
))
DBUG_RETURN
(
0
);
}
DBUG_PRINT
(
"error"
,(
"errno: %d"
,
errno
));
my_errno
=
errno
;
if
(
MyFlags
&
MY_WME
)
my_error
(
EE_CANT_CHSIZE
,
MYF
(
ME_BELL
+
ME_WAITTANG
),
errno
);
DBUG_RETURN
(
1
);
}
#elif defined(HAVE_FTRUNCATE)
if
(
oldsize
>
newlength
)
{
if
(
ftruncate
(
fd
,
(
off_t
)
newlength
))
...
...
@@ -99,5 +121,6 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
DBUG_PRINT
(
"error"
,(
"errno: %d"
,
my_errno
));
DBUG_RETURN
(
1
);
}
#endif
}
/* my_chsize */
}
/* my_chsize */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment