Fix: rmdir recursive: skip non-empty directories with flag
[lttng-tools.git] / src / common / compat / directory-handle.h
index 6f2df1ba18c2eeb4048f9a636979175456e6ed94..26da76bcc7d7a751971adee30a9cd252f2235a84 100644 (file)
 #include <common/macros.h>
 #include <common/credentials.h>
 
 #include <common/macros.h>
 #include <common/credentials.h>
 
+enum lttng_directory_handle_rmdir_recursive_flags {
+       LTTNG_DIRECTORY_HANDLE_FAIL_NON_EMPTY_FLAG = (1U << 0),
+       LTTNG_DIRECTORY_HANDLE_SKIP_NON_EMPTY_FLAG = (1U << 1),
+};
+
 /*
  * Some platforms, such as Solaris 10, do not support directory file descriptors
  * and their associated functions (*at(...)), which are defined in POSIX.2008.
 /*
  * Some platforms, such as Solaris 10, do not support directory file descriptors
  * and their associated functions (*at(...)), which are defined in POSIX.2008.
@@ -233,20 +238,23 @@ int lttng_directory_handle_remove_subdirectory_as_user(
 /*
  * Remove a subdirectory and remove its contents if it only
  * consists in empty directories.
 /*
  * Remove a subdirectory and remove its contents if it only
  * consists in empty directories.
+ * @flags: enum lttng_directory_handle_rmdir_recursive_flags
  */
 LTTNG_HIDDEN
 int lttng_directory_handle_remove_subdirectory_recursive(
                const struct lttng_directory_handle *handle,
  */
 LTTNG_HIDDEN
 int lttng_directory_handle_remove_subdirectory_recursive(
                const struct lttng_directory_handle *handle,
-               const char *name);
+               const char *name, int flags);
 
 /*
  * Remove a subdirectory and remove its contents if it only
  * consists in empty directories as a given user.
 
 /*
  * Remove a subdirectory and remove its contents if it only
  * consists in empty directories as a given user.
+ * @flags: enum lttng_directory_handle_rmdir_recursive_flags
  */
 LTTNG_HIDDEN
 int lttng_directory_handle_remove_subdirectory_recursive_as_user(
                const struct lttng_directory_handle *handle,
                const char *name,
  */
 LTTNG_HIDDEN
 int lttng_directory_handle_remove_subdirectory_recursive_as_user(
                const struct lttng_directory_handle *handle,
                const char *name,
-               const struct lttng_credentials *creds);
+               const struct lttng_credentials *creds,
+               int flags);
 
 #endif /* _COMPAT_PATH_HANDLE_H */
 
 #endif /* _COMPAT_PATH_HANDLE_H */
This page took 0.025766 seconds and 4 git commands to generate.