63 lines
2.0 KiB
Diff
63 lines
2.0 KiB
Diff
From 262cbd38ad6bd1ba0168b3fcfc8f3302127efdf4 Mon Sep 17 00:00:00 2001
|
|
From: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Date: Fri, 26 Apr 2013 09:30:05 +1000
|
|
Subject: [PATCH libwacom] tools: use stdout for printing, not stdin
|
|
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Reported-by: Joaquim Rocha <jrocha@redhat.com>
|
|
Tested-by: Joaquim Rocha <jrocha@redhat.com>
|
|
---
|
|
tools/list-devices.c | 3 ++-
|
|
tools/list-local-devices.c | 5 +++--
|
|
2 files changed, 5 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/tools/list-devices.c b/tools/list-devices.c
|
|
index 4a96434..79d13e8 100644
|
|
--- a/tools/list-devices.c
|
|
+++ b/tools/list-devices.c
|
|
@@ -31,6 +31,7 @@
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <assert.h>
|
|
+#include <unistd.h>
|
|
#include "libwacom.h"
|
|
|
|
static void print_device_info (WacomDevice *device, WacomBusType bus_type_filter)
|
|
@@ -40,7 +41,7 @@ static void print_device_info (WacomDevice *device, WacomBusType bus_type_filter
|
|
for (match = libwacom_get_matches(device); *match; match++) {
|
|
WacomBusType type = libwacom_match_get_bustype(*match);
|
|
if (type != bus_type_filter)
|
|
- libwacom_print_device_description(0, device);
|
|
+ libwacom_print_device_description(STDOUT_FILENO, device);
|
|
}
|
|
}
|
|
|
|
diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c
|
|
index 17cd28c..6aa7600 100644
|
|
--- a/tools/list-local-devices.c
|
|
+++ b/tools/list-local-devices.c
|
|
@@ -31,6 +31,7 @@
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
+#include <unistd.h>
|
|
#include <assert.h>
|
|
#include <dirent.h>
|
|
#include <glib/gi18n.h>
|
|
@@ -98,10 +99,10 @@ int main(int argc, char **argv)
|
|
dev = libwacom_new_from_path(db, fname, WFALLBACK_NONE, NULL);
|
|
if (!dev)
|
|
continue;
|
|
- libwacom_print_device_description(0, dev);
|
|
+ libwacom_print_device_description(STDOUT_FILENO, dev);
|
|
libwacom_destroy(dev);
|
|
|
|
- fprintf(stdout, "---------------------------------------------------------------\n");
|
|
+ dprintf(STDOUT_FILENO, "---------------------------------------------------------------\n");
|
|
}
|
|
|
|
out:
|
|
--
|
|
1.8.1.4
|
|
|