return levels;
}
-int pakfire_file_open(struct pakfire_file* file) {
+int pakfire_file_open(struct pakfire_file* file, int flags) {
const char* path = NULL;
int fd = -EBADF;
}
// Open the file
- fd = open(path, O_CLOEXEC);
+ fd = open(path, flags|O_CLOEXEC);
if (fd < 0) {
ERROR(file->ctx, "Could not open %s: %m\n", path);
return -errno;
int fd = -EBADF;
// Open the file descriptor
- fd = pakfire_file_open(file);
+ fd = pakfire_file_open(file, O_RDONLY);
if (fd < 0)
return NULL;
const char* pakfire_file_get_abspath(struct pakfire_file* file);
-int pakfire_file_open(struct pakfire_file* file);
+int pakfire_file_open(struct pakfire_file* file, int flags);
FILE* pakfire_file_fopen(struct pakfire_file* file);
int pakfire_file_payload_matches(struct pakfire_file* file,