1
0

exile_launch(): Improve handling/logging of errors

Dieser Commit ist enthalten in:
Albert S. 2022-01-16 21:28:21 +01:00
Ursprung ed54575b89
Commit 4a3ac8e0bc

Datei anzeigen

@ -2133,19 +2133,21 @@ char *exile_launch_get(struct exile_launch_params *launch_params, size_t *n)
{ {
continue; continue;
} }
EXILE_LOG_ERROR("Failed to read from read file descriptor\n");
close(launch_result.read_fd);
fclose(stream);
return NULL; return NULL;
} }
size_t written = fwrite(buffer, 1, ret, stream); size_t written = fwrite(buffer, 1, ret, stream);
if(written != (size_t) ret) if(written != (size_t) ret)
{ {
if(ferror(stream)) EXILE_LOG_ERROR("Short item write");
{
/* TODO: can we seek and free? */ /* TODO: can we seek and free? */
close(launch_result.read_fd); close(launch_result.read_fd);
fclose(stream);
return NULL; return NULL;
} }
} }
}
fclose(stream); fclose(stream);
int seek = fseek(stream, 0, SEEK_SET); int seek = fseek(stream, 0, SEEK_SET);
if(seek == -1) if(seek == -1)