}
int fchmod_opath(int fd, mode_t m) {
- char procfs_path[strlen("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
+ char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
/* This function operates also on fd that might have been opened with
* O_PATH. Indeed fchmodat() doesn't have the AT_EMPTY_PATH flag like
return r;
}
-void unlink_tempfilep(char (*p)[]) {
- /* If the file is created with mkstemp(), it will (almost always)
- * change the suffix. Treat this as a sign that the file was
- * successfully created. We ignore both the rare case where the
- * original suffix is used and unlink failures. */
- if (!endswith(*p, ".XXXXXX"))
- (void) unlink(*p);
-}
-
int unlinkat_deallocate(int fd, const char *name, int flags) {
_cleanup_close_ int truncate_fd = -1;
struct stat st;