screenshooter: Report an error if we fail to open the file
This commit is contained in:
parent
4988703086
commit
ba1e292779
@ -404,9 +404,6 @@ weston_recorder_create(struct weston_output *output, const char *filename)
|
|||||||
recorder->output = output;
|
recorder->output = output;
|
||||||
memset(recorder->frame, 0, size);
|
memset(recorder->frame, 0, size);
|
||||||
|
|
||||||
recorder->fd = open(filename,
|
|
||||||
O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
|
|
||||||
|
|
||||||
header.magic = WCAP_HEADER_MAGIC;
|
header.magic = WCAP_HEADER_MAGIC;
|
||||||
|
|
||||||
switch (output->compositor->read_format) {
|
switch (output->compositor->read_format) {
|
||||||
@ -421,6 +418,14 @@ weston_recorder_create(struct weston_output *output, const char *filename)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
recorder->fd = open(filename,
|
||||||
|
O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
|
||||||
|
|
||||||
|
if (recorder->fd < 0) {
|
||||||
|
weston_log("problem opening output file %s: %m\n", filename);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
header.width = output->current->width;
|
header.width = output->current->width;
|
||||||
header.height = output->current->height;
|
header.height = output->current->height;
|
||||||
recorder->total += write(recorder->fd, &header, sizeof header);
|
recorder->total += write(recorder->fd, &header, sizeof header);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user