Use stdout, not stdin for printing
This commit is contained in:
parent
dca19d7ea4
commit
1e518bd968
62
0001-tools-use-stdout-for-printing-not-stdin.patch
Normal file
62
0001-tools-use-stdout-for-printing-not-stdin.patch
Normal file
@ -0,0 +1,62 @@
|
||||
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
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
Name: libwacom
|
||||
|
||||
Version: 0.7.1
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: Tablet Information Client Library
|
||||
Requires: %{name}-data
|
||||
|
||||
@ -14,6 +14,8 @@ URL: http://linuxwacom.sourceforge.net
|
||||
Source0: http://prdownloads.sourceforge.net/linuxwacom/%{name}/%{name}-%{version}.tar.bz2
|
||||
Source1: libwacom.rules
|
||||
|
||||
Patch01: 0001-tools-use-stdout-for-printing-not-stdin.patch
|
||||
|
||||
BuildRequires: autoconf automake libtool doxygen
|
||||
BuildRequires: glib2-devel libgudev1-devel
|
||||
BuildRequires: systemd-devel
|
||||
@ -40,6 +42,7 @@ Tablet information client library library data files.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%patch01 -p1
|
||||
|
||||
%build
|
||||
autoreconf --force -v --install || exit 1
|
||||
@ -80,6 +83,9 @@ rm -f %{buildroot}%{_libdir}/*.la
|
||||
%{_datadir}/libwacom/layouts/*.svg
|
||||
|
||||
%changelog
|
||||
* Wed May 01 2013 Peter Hutterer <peter.hutterer@redhat.com> 0.7.1-2
|
||||
- Use stdout, not stdin for printing
|
||||
|
||||
* Tue Apr 16 2013 Peter Hutterer <peter.hutterer@redhat.com> 0.7.1-1
|
||||
- libwacom 0.7.1
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user