result = remove(path);
}
- // @todo properly handle the correct error codes, this was simply copied over from f_file_remove().
-
if (result < 0) {
if (errno == EACCES) {
return f_status_set_error(f_access_denied);
else if (errno == EROFS) {
return f_status_set_error(f_read_only);
}
+ else if (errno == EOVERFLOW) {
+ return f_status_set_error(f_number_overflow);
+ }
+ else if (errno == EMFILE) {
+ return f_status_set_error(f_file_max_descriptors);
+ }
+ else if (errno == ENFILE) {
+ return f_status_set_error(f_file_max_open);
+ }
+ else if (errno == EINVAL) {
+ return f_status_set_error(f_invalid_parameter);
+ }
return f_status_set_error(f_failure);
}
result = remove(path);
}
- // @todo properly handle the correct error codes, this was simply copied over from f_file_remove().
-
if (result < 0) {
if (errno == EACCES) {
return f_status_set_error(f_access_denied);
else if (errno == EROFS) {
return f_status_set_error(f_read_only);
}
+ else if (errno == EOVERFLOW) {
+ return f_status_set_error(f_number_overflow);
+ }
+ else if (errno == EMFILE) {
+ return f_status_set_error(f_file_max_descriptors);
+ }
+ else if (errno == ENFILE) {
+ return f_status_set_error(f_file_max_open);
+ }
+ else if (errno == EINVAL) {
+ return f_status_set_error(f_invalid_parameter);
+ }
return f_status_set_error(f_failure);
}
* f_prohibited (with error bit) if filesystem does not allow for removing.
* f_read_only (with error bit) if file is read-only.
* f_failure (with error bit) for any other (unlink()) error.
+ * f_number_overflow (with error bit) on integer overflow.
+ * f_file_max_descriptors (with error bit) if max file descriptors was reached.
+ * f_file_max_open (with error bit) too many open files.
*
* @see nftw()
* @see remove()
* f_directory_error_descriptor (with error bit) on directory file descriptor error.
* f_directory_error_stream (with error bit) on directory stream error.
* f_directory_error_unsupported (with error bit) on directory file descriptor not supported.
+ * f_file_max_descriptors (with error bit) if max file descriptors was reached.
+ * f_file_max_open (with error bit) too many open files.
*
* @see alphasort()
* @see scandir()