[PATCH xorg-gtest 3/6] device: split device comparison into a helper function

Chase Douglas chase.douglas at canonical.com
Wed Aug 29 16:24:59 PDT 2012


On 08/29/2012 03:29 PM, Peter Hutterer wrote:
> On Wed, Aug 29, 2012 at 01:07:31PM -0700, Chase Douglas wrote:
>> On 08/28/2012 11:14 PM, Peter Hutterer wrote:
>>> No functional changes, we'll re-use this though.
>>>
>>> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
>>> ---
>>>   src/device.cpp | 38 +++++++++++++++++++++++---------------
>>>   1 file changed, 23 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/src/device.cpp b/src/device.cpp
>>> index ffe33c6..5868036 100644
>>> --- a/src/device.cpp
>>> +++ b/src/device.cpp
>>> @@ -62,6 +62,26 @@ static int _event_device_filter(const struct dirent *d) {
>>>     return (strncmp("event", d->d_name, sizeof("event") - 1) == 0);
>>>   }
>>>
>>> +static bool event_is_device(const std::string &path,
>>> +                            const std::string &devname,
>>> +                            time_t ctime) {
>>> +    char device_name[256];
>>> +    bool equal = false;
>>> +    int fd = open(path.c_str(), O_RDONLY);
>>
>> There's no error check here. It's possible that the path has ceased
>> to exist or can't be opened for some other reason.
>
> this is code that moved place, so I didn't fix this bit up in this patch,
> it's fixed in patch 4/6. If need be, I can squash the two together.

Oh right, sorry I forgot about patch 4/6. All's well.

Reviewed-by: Chase Douglas <chase.douglas at canonical.com>


More information about the xorg-devel mailing list