return 0;
}
-void unlink_tempfilep(char (*p)[]) {
- assert(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, UnlinkDeallocateFlags flags) {
_cleanup_close_ int truncate_fd = -EBADF;
struct stat st;
int access_fd(int fd, int mode);
-void unlink_tempfilep(char (*p)[]);
-
typedef enum UnlinkDeallocateFlags {
UNLINK_REMOVEDIR = 1 << 0,
UNLINK_ERASE = 1 << 1,
return 0;
}
+void unlink_tempfilep(char (*p)[]) {
+ assert(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);
+}
+
static int tempfn_build(const char *p, const char *pre, const char *post, bool child, char **ret) {
_cleanup_free_ char *d = NULL, *fn = NULL, *nf = NULL, *result = NULL;
size_t len_pre, len_post, len_add;
int mkostemp_safe(char *pattern);
int fmkostemp_safe(char *pattern, const char *mode, FILE**_f);
+void unlink_tempfilep(char (*p)[]);
+
int tempfn_xxxxxx(const char *p, const char *extra, char **ret);
int tempfn_random(const char *p, const char *extra, char **ret);
int tempfn_random_child(const char *p, const char *extra, char **ret);