Commit Graph

4 Commits

Author SHA1 Message Date
Érico Nogueira 90693c6d04 Fix build on older glibc versions.
_POSIX_C_SOURCE is necessary for getopt(3), and _DEFAULT_SOURCE is
necessary for the d_type enumerations in struct dirent.

Since we are here, use the C11 standard explicitly.

These fixes only allow us to build with glibc>=2.28, which is when the
<threads.h> header was added [1], necessary to access the thread_local
macro.

[1] https://stackoverflow.com/a/22875599
2023-07-26 10:17:48 -03:00
Érico Nogueira ff3cbb8471 Update Makefile. 2021-09-18 16:08:44 -03:00
Érico Nogueira e24aef5395 Split implementation into two files.
- also fix threadings bugs: threads could leak (if the join loop exited
  due to some error) or non existent threads could be joined (we add the
  created struct member to avoid this)
2021-05-18 00:35:30 -03:00
Érico Nogueira 4bdc7f18c5 Initial commit.
Can delete a sequence of files of directories in the command line, no
recursion yet.

Assumes remove(3) is fast and reasonable:

   unlink(); if (errno==EISDIR) rmdir();
2021-05-17 23:29:05 -03:00