summaryrefslogtreecommitdiff
path: root/glnx-fdio.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-06-26 13:04:35 -0400
committerColin Walters <walters@verbum.org>2017-06-26 13:37:05 -0400
commit4d34066a2ff5d806db35c3ac765f87ace460fa7e (patch)
tree7c56f74cc616c01b2569f5b0c4204aa70983c747 /glnx-fdio.c
parentcaa51ac24ffcdffcb610bc6ccc9da964d4be74ee (diff)
downloadlibglnx-4d34066a2ff5d806db35c3ac765f87ace460fa7e.tar.gz
fdio: Add wrappers for renameat(), unlinkat()
Besides doing `TEMP_FAILURE_RETRY` and `GError` conversion, these also prefix the error with arguments.
Diffstat (limited to 'glnx-fdio.c')
-rw-r--r--glnx-fdio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/glnx-fdio.c b/glnx-fdio.c
index e496828..b5eaa9e 100644
--- a/glnx-fdio.c
+++ b/glnx-fdio.c
@@ -319,15 +319,13 @@ glnx_link_tmpfile_at (GLnxTmpfile *tmpf,
"Exhausted %u attempts to create temporary file", count);
return FALSE;
}
- if (renameat (target_dfd, tmpname_buf, target_dfd, target) < 0)
+ if (!glnx_renameat (target_dfd, tmpname_buf, target_dfd, target, error))
{
/* This is currently the only case where we need to have
* a cleanup unlinkat() still with O_TMPFILE.
*/
- int errsv = errno;
(void) unlinkat (target_dfd, tmpname_buf, 0);
- errno = errsv;
- return glnx_throw_errno_prefix (error, "renameat");
+ return FALSE;
}
}
else