/* This file is part of limb https://lila.oss/limb
* Copyright (C) 2023 Olivier Brunel jjk@jjacky.com */
/* SPDX-License-Identifier: GPL-2.0-only */
#include <limb/djbunix.h>
int
rm_rf_tmpat(int fd, const char *name, stralloc *sa)
{
size_t salen = sa->len;
int ret = 0;
if (!stralloc_cats(sa, name) || !stralloc_0(sa)
|| rm_rf_in_tmpat(fd, sa, salen) < 0)
ret = -1;
sa->len = salen;
return ret;
}