Skip to content
Snippets Groups Projects
Commit b3c8e3f7 authored by Georgy Kirichenko's avatar Georgy Kirichenko
Browse files

Preserve errno in fil_filename func. Issue #1902

fio_filename replace errno by readlink call and can
be used for error logging
parent 4724bd24
No related branches found
No related tags found
Loading
......@@ -47,6 +47,7 @@ const char *
fio_filename(int fd)
{
#ifdef TARGET_OS_LINUX
int save_errno = errno;
char proc_path[32];
static __thread char filename_path[PATH_MAX];
......@@ -54,7 +55,7 @@ fio_filename(int fd)
ssize_t sz = readlink(proc_path, filename_path,
sizeof(filename_path));
errno = save_errno;
if (sz >= 0) {
filename_path[sz] = '\0';
return filename_path;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment