summaryrefslogtreecommitdiff
path: root/src/libunixonacid/dd_cancel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libunixonacid/dd_cancel.c')
-rw-r--r--src/libunixonacid/dd_cancel.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libunixonacid/dd_cancel.c b/src/libunixonacid/dd_cancel.c
new file mode 100644
index 0000000..22adf4e
--- /dev/null
+++ b/src/libunixonacid/dd_cancel.c
@@ -0,0 +1,17 @@
+/* ISC license. */
+
+#include <errno.h>
+#include <skalibs/stralloc.h>
+#include <skalibs/djbunix.h>
+#include <skalibs/unix-transactional.h>
+
+void dd_cancel (dirdescriptor_t_ref dd)
+{
+ dirdescriptor_t zero = DIRDESCRIPTOR_ZERO ;
+ register int e = errno ;
+ fd_close(dd->fd) ;
+ rm_rf_in_tmp(&dd->new, 0) ;
+ stralloc_free(&dd->new) ;
+ *dd = zero ;
+ errno = e ;
+}