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
4e9f2d24
Commit
4e9f2d24
authored
Jul 30, 2008
by
Magnus Svensson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always print errno after failed file operation
parent
4b9e18b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
client/mysqltest.c
client/mysqltest.c
+5
-5
No files found.
client/mysqltest.c
View file @
4e9f2d24
...
@@ -2266,7 +2266,7 @@ int open_file(const char *name)
...
@@ -2266,7 +2266,7 @@ int open_file(const char *name)
if
(
!
(
cur_file
->
file
=
my_fopen
(
buff
,
O_RDONLY
|
FILE_BINARY
,
MYF
(
0
))))
if
(
!
(
cur_file
->
file
=
my_fopen
(
buff
,
O_RDONLY
|
FILE_BINARY
,
MYF
(
0
))))
{
{
cur_file
--
;
cur_file
--
;
die
(
"Could not open '%s' for reading
"
,
buff
);
die
(
"Could not open '%s' for reading
, errno: %d"
,
buff
,
errno
);
}
}
cur_file
->
file_name
=
my_strdup
(
buff
,
MYF
(
MY_FAE
));
cur_file
->
file_name
=
my_strdup
(
buff
,
MYF
(
MY_FAE
));
cur_file
->
lineno
=
1
;
cur_file
->
lineno
=
1
;
...
@@ -5474,7 +5474,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
...
@@ -5474,7 +5474,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
DBUG_ASSERT
(
cur_file
==
file_stack
&&
cur_file
->
file
==
0
);
DBUG_ASSERT
(
cur_file
==
file_stack
&&
cur_file
->
file
==
0
);
if
(
!
(
cur_file
->
file
=
if
(
!
(
cur_file
->
file
=
my_fopen
(
buff
,
O_RDONLY
|
FILE_BINARY
,
MYF
(
0
))))
my_fopen
(
buff
,
O_RDONLY
|
FILE_BINARY
,
MYF
(
0
))))
die
(
"Could not open '%s' for reading
: errno =
%d"
,
buff
,
errno
);
die
(
"Could not open '%s' for reading
, errno:
%d"
,
buff
,
errno
);
cur_file
->
file_name
=
my_strdup
(
buff
,
MYF
(
MY_FAE
));
cur_file
->
file_name
=
my_strdup
(
buff
,
MYF
(
MY_FAE
));
cur_file
->
lineno
=
1
;
cur_file
->
lineno
=
1
;
break
;
break
;
...
@@ -5591,11 +5591,11 @@ void str_to_file2(const char *fname, char *str, int size, my_bool append)
...
@@ -5591,11 +5591,11 @@ void str_to_file2(const char *fname, char *str, int size, my_bool append)
flags
|=
O_TRUNC
;
flags
|=
O_TRUNC
;
if
((
fd
=
my_open
(
buff
,
flags
,
if
((
fd
=
my_open
(
buff
,
flags
,
MYF
(
MY_WME
|
MY_FFNF
)))
<
0
)
MYF
(
MY_WME
|
MY_FFNF
)))
<
0
)
die
(
"Could not open '%s' for writing
: errno =
%d"
,
buff
,
errno
);
die
(
"Could not open '%s' for writing
, errno:
%d"
,
buff
,
errno
);
if
(
append
&&
my_seek
(
fd
,
0
,
SEEK_END
,
MYF
(
0
))
==
MY_FILEPOS_ERROR
)
if
(
append
&&
my_seek
(
fd
,
0
,
SEEK_END
,
MYF
(
0
))
==
MY_FILEPOS_ERROR
)
die
(
"Could not find end of file '%s'
: errno =
%d"
,
buff
,
errno
);
die
(
"Could not find end of file '%s'
, errno:
%d"
,
buff
,
errno
);
if
(
my_write
(
fd
,
(
uchar
*
)
str
,
size
,
MYF
(
MY_WME
|
MY_FNABP
)))
if
(
my_write
(
fd
,
(
uchar
*
)
str
,
size
,
MYF
(
MY_WME
|
MY_FNABP
)))
die
(
"write failed
"
);
die
(
"write failed
, errno: %d"
,
errno
);
my_close
(
fd
,
MYF
(
0
));
my_close
(
fd
,
MYF
(
0
));
}
}
...
...
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