}
static int pakfire_read_os_release(Pakfire pakfire) {
- int r = 0;
+ char* line = NULL;
+ size_t l = 0;
+ int r = 1;
char* path = pakfire_make_path(pakfire, "/etc/os-release");
if (!path)
FILE* f = fopen(path, "r");
if (!f) {
+ // Ignore when the file does not exist
+ if (errno == ENOENT)
+ goto ERROR;
+
ERROR(pakfire, "Could not open %s: %s\n", path, strerror(errno));
- r = -1;
+ r = 1;
goto ERROR;
}
- char* line = NULL;
- size_t l = 0;
-
while (1) {
ssize_t bytes_read = getline(&line, &l, f);
if (bytes_read < 0)
// Read /etc/os-release
r = pakfire_read_os_release(p);
- if (r)
+ if (r && errno != ENOENT)
goto ERROR;
DEBUG(p, "Pakfire initialized at %p\n", p);