mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-06 07:58:08 +02:00
screenshooter: Report an error if we fail to open the file
This commit is contained in:
parent
ce6d79e665
commit
15b3caf2ea
1 changed files with 8 additions and 3 deletions
|
|
@ -413,9 +413,6 @@ weston_recorder_create(struct weston_output *output, const char *filename)
|
|||
recorder->output = output;
|
||||
memset(recorder->frame, 0, size);
|
||||
|
||||
recorder->fd = open(filename,
|
||||
O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
|
||||
|
||||
header.magic = WCAP_HEADER_MAGIC;
|
||||
|
||||
switch (output->compositor->read_format) {
|
||||
|
|
@ -427,6 +424,14 @@ weston_recorder_create(struct weston_output *output, const char *filename)
|
|||
break;
|
||||
}
|
||||
|
||||
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.height = output->current->height;
|
||||
recorder->total += write(recorder->fd, &header, sizeof header);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue