aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTudor Brindus <me@tbrindus.ca>2020-10-10 22:57:45 -0400
committerSimon Ser <contact@emersion.fr>2020-10-11 06:36:23 +0200
commitec3f432bbb4cbcb75adc695753353239e017a8bd (patch)
tree121a656d43e54c237703ba9cddee022cd94e1b2b
parent45c1a3621cc6874e5b5d9694015241668980df5d (diff)
examples: use `perror` instead of `fprintf` GNU %m `printf` extension
-rw-r--r--examples/screencopy-dmabuf.c6
-rw-r--r--examples/screencopy.c4
-rw-r--r--examples/virtual-pointer.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/screencopy-dmabuf.c b/examples/screencopy-dmabuf.c
index 2525efc5..e7657e1a 100644
--- a/examples/screencopy-dmabuf.c
+++ b/examples/screencopy-dmabuf.c
@@ -297,7 +297,7 @@ int main(int argc, char *argv[]) {
drm_fd = open(render_node, O_RDWR);
if (drm_fd < 0) {
- fprintf(stderr, "Failed to open drm render node: %m\n");
+ perror("Failed to open drm render node");
return EXIT_FAILURE;
}
@@ -309,7 +309,7 @@ int main(int argc, char *argv[]) {
struct wl_display *display = wl_display_connect(NULL);
if (display == NULL) {
- fprintf(stderr, "failed to create display: %m\n");
+ perror("failed to create display");
return EXIT_FAILURE;
}
@@ -343,7 +343,7 @@ int main(int argc, char *argv[]) {
void *data = gbm_bo_map(buffer.bo, 0, 0, buffer.width, buffer.height,
GBM_BO_TRANSFER_READ, &stride, &map_data);
if (!data) {
- fprintf(stderr, "Failed to map gbm bo: %m\n");
+ perror("Failed to map gbm bo");
return EXIT_FAILURE;
}
diff --git a/examples/screencopy.c b/examples/screencopy.c
index 0e03a238..42123e55 100644
--- a/examples/screencopy.c
+++ b/examples/screencopy.c
@@ -90,7 +90,7 @@ static struct wl_buffer *create_shm_buffer(enum wl_shm_format fmt,
void *data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (data == MAP_FAILED) {
- fprintf(stderr, "mmap failed: %m\n");
+ perror("mmap failed");
close(fd);
return NULL;
}
@@ -228,7 +228,7 @@ static void write_image(char *filename, enum wl_shm_format wl_fmt, int width,
int main(int argc, char *argv[]) {
struct wl_display * display = wl_display_connect(NULL);
if (display == NULL) {
- fprintf(stderr, "failed to create display: %m\n");
+ perror("failed to create display");
return EXIT_FAILURE;
}
diff --git a/examples/virtual-pointer.c b/examples/virtual-pointer.c
index 8fd14830..b91768a4 100644
--- a/examples/virtual-pointer.c
+++ b/examples/virtual-pointer.c
@@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
}
struct wl_display * display = wl_display_connect(NULL);
if (display == NULL) {
- fprintf(stderr, "failed to create display: %m\n");
+ perror("failed to create display");
return EXIT_FAILURE;
}