- update to release 1.1.4; changes since 1.1.0:

* mtdev_close should ignore NULL devices.
  * Return EINVAL for invalid parameters on mtdev_init.
  * Add the missing distance event to the internal slot
    representation
  * Add support for kernel MT slot state retrieval
  * Fix pc file to allow compiling with mtdev installed in non-std
    path.
  * Drop maintainer mode - enable by default
  * Rename INCLUDES to AM_CPPFLAGS
  * Merge build fixes from Peter Hutterer.
  * Replace hardcoded 11 with a define
  * Fix compiler warning - implicit declaration of function 'abs'
  * test: silence compiler warning - implicit declaration of function
    ‘atoi’
  * Enable silent rules by default
  * Merge more build fixes from Peter Hutterer, along with a more
    explicit declaration of the backwards compatibility constraints
    on the API.
- removed obsolete patches:
  * U_Return-EINVAL-for-invalid-parameters-on-mtdev_init.patch
  * U_mtdev_close-should-ignore-NULL-devices.patch
  * mtdev-implicit.diff

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/mtdev?expand=0&rev=9
This commit is contained in:
Stefan Dirsch 2013-09-05 14:08:05 +00:00 committed by Git OBS Bridge
parent b6209faa2e
commit cfbb761258
7 changed files with 34 additions and 137 deletions

View File

@ -1,31 +0,0 @@
From 3aa3de4c19b80caaf93812fafff20acd5f5a4d12 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 19 Apr 2011 11:45:45 +0200
Subject: [PATCH 2/2] Return EINVAL for invalid parameters on mtdev_init.
[rydberg@euromail.se: minor cleanup]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
src/core.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/core.c b/src/core.c
index 07bc828..87ef420 100644
--- a/src/core.c
+++ b/src/core.c
@@ -359,7 +359,10 @@ int mtdev_init(struct mtdev *dev)
int mtdev_open(struct mtdev *dev, int fd)
{
- int ret;
+ int ret = -EINVAL;
+
+ if (!dev || fd < 0)
+ goto error;
ret = mtdev_init(dev);
if (ret)
goto error;
--
1.7.6

View File

@ -1,48 +0,0 @@
From 61684cf0466200631b6a44af1c662eb760ad3f5d Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 19 Apr 2011 11:41:04 +0200
Subject: [PATCH 1/2] mtdev_close should ignore NULL devices.
Saves us one goto label in mtdev_init.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
src/core.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/core.c b/src/core.c
index 1f7c1fe..07bc828 100644
--- a/src/core.c
+++ b/src/core.c
@@ -365,11 +365,11 @@ int mtdev_open(struct mtdev *dev, int fd)
goto error;
ret = mtdev_configure(dev, fd);
if (ret)
- goto mtdev;
+ goto error;
return 0;
- mtdev:
- mtdev_close(dev);
+
error:
+ mtdev_close(dev);
return ret;
}
@@ -411,8 +411,10 @@ void mtdev_close_delete(struct mtdev *dev)
void mtdev_close(struct mtdev *dev)
{
- free(dev->state);
- memset(dev, 0, sizeof(struct mtdev));
+ if (dev) {
+ free(dev->state);
+ memset(dev, 0, sizeof(struct mtdev));
+ }
}
void mtdev_delete(struct mtdev *dev)
--
1.7.6

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4cdd9f72ea04536788ddf2ddef7279abb44b7b4a466e6bd01bdd975cf236aa50
size 246508

3
mtdev-1.1.4.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6b59b055ff22f2b91d4284187c2515826c338b81f6f33bd90f6bedc7c1fb9a38
size 273780

View File

@ -1,45 +0,0 @@
From: Jan Engelhardt <jengelh@medozas.de>
Date: 2012-02-12 19:46:35.478843702 +0100
build: resolve compiler warnings due to use of impl.-decl. fns
match_four.c: In function 'set_dist':
match_four.c:79:4: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
mtdev-kernel.c: In function 'main':
mtdev-kernel.c:130:2: warning: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
---
src/match_four.c | 1 +
test/mtdev-kernel.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
Index: mtdev-1.1.0/src/match_four.c
===================================================================
--- mtdev-1.1.0.orig/src/match_four.c
+++ mtdev-1.1.0/src/match_four.c
@@ -1,3 +1,4 @@
+#include <math.h>
#include "match.h"
#include <limits.h>
Index: mtdev-1.1.0/test/mtdev-kernel.c
===================================================================
--- mtdev-1.1.0.orig/test/mtdev-kernel.c
+++ mtdev-1.1.0/test/mtdev-kernel.c
@@ -26,6 +26,7 @@
*
****************************************************************************/
+#include <stdlib.h>
#include <../src/common.h>
#include <stdio.h>
#include <time.h>
@@ -127,7 +128,7 @@ int main(int argc, char *argv[])
return 1;
}
- eslot = atoi(argv[1]) + 1;
+ eslot = strtol(argv[1], NULL, 0) + 1;
if (eslot > SLOT_CNT) {
fprintf(stderr, "allowed slot range: 2 - %d\n", SLOT_MAX);
return 1;

View File

@ -1,3 +1,30 @@
-------------------------------------------------------------------
Thu Sep 5 13:53:53 UTC 2013 - sndirsch@suse.com
- update to release 1.1.4; changes since 1.1.0:
* mtdev_close should ignore NULL devices.
* Return EINVAL for invalid parameters on mtdev_init.
* Add the missing distance event to the internal slot
representation
* Add support for kernel MT slot state retrieval
* Fix pc file to allow compiling with mtdev installed in non-std
path.
* Drop maintainer mode - enable by default
* Rename INCLUDES to AM_CPPFLAGS
* Merge build fixes from Peter Hutterer.
* Replace hardcoded 11 with a define
* Fix compiler warning - implicit declaration of function 'abs'
* test: silence compiler warning - implicit declaration of function
atoi
* Enable silent rules by default
* Merge more build fixes from Peter Hutterer, along with a more
explicit declaration of the backwards compatibility constraints
on the API.
- removed obsolete patches:
* U_Return-EINVAL-for-invalid-parameters-on-mtdev_init.patch
* U_mtdev_close-should-ignore-NULL-devices.patch
* mtdev-implicit.diff
-------------------------------------------------------------------
Sun Feb 12 18:48:05 UTC 2012 - jengelh@medozas.de

View File

@ -1,7 +1,7 @@
#
# spec file for package mtdev
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,18 +16,14 @@
#
Name: mtdev
BuildRequires: pkgconfig
Summary: Multitouch Protocol Translation Library
License: MIT
Group: System/Libraries
Version: 1.1.0
Version: 1.1.4
Release: 0
Source: http://bitmath.org/code/mtdev/mtdev-%{version}.tar.bz2
Patch1: U_mtdev_close-should-ignore-NULL-devices.patch
Patch2: U_Return-EINVAL-for-invalid-parameters-on-mtdev_init.patch
Patch3: mtdev-implicit.diff
Url: http://bitmath.org/code/mtdev/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -44,16 +40,14 @@ The mtdev is a stand-alone library which transforms all variants of kernel MT ev
%package devel
Summary: Development package for mtdev library
Group: Development/Libraries/C and C++
Requires: libmtdev1 = %{version} glibc-devel
Requires: glibc-devel
Requires: libmtdev1 = %{version}
%description devel
This package contains the files needed to compile programs that use mtdev library.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch -P 3 -p1
%build
%configure --disable-static