I really dislike these surprises :)
This issue couldn't be reported to kernel devs ?
Or this issue is from dsdt and acpi from vendors ?
Not in view to remove the work around...

2012/5/25 Enlightenment SVN <no-re...@enlightenment.org>

> Log:
> work around ppurka's demented laptop.
>
>
>
> Author:       raster
> Date:         2012-05-24 17:09:15 -0700 (Thu, 24 May 2012)
> New Revision: 71414
> Trac:         http://trac.enlightenment.org/e/changeset/71414
>
> Modified:
>  trunk/e/src/bin/e_acpi.c
>
> Modified: trunk/e/src/bin/e_acpi.c
> ===================================================================
> --- trunk/e/src/bin/e_acpi.c    2012-05-24 17:24:46 UTC (rev 71413)
> +++ trunk/e/src/bin/e_acpi.c    2012-05-25 00:09:15 UTC (rev 71414)
> @@ -324,7 +324,25 @@
>
>    /* open the state file from /proc */
>    snprintf(buff, sizeof(buff), "/proc/acpi/%s/%s/state", device, bus);
> -   if (!(f = fopen(buff, "r"))) return E_ACPI_LID_UNKNOWN;
> +   if (!(f = fopen(buff, "r")))
> +     {
> +        /* hack around ppurka's Thinkpad (G460 + Linux) that reports lid
> +         * state as "/proc/acpi/button/lid/LID0/state" but where the lid
> +         * event says "button/lid LID close".
> +         *
> +         * so let's take the base device name "LID" and add a numeric like
> +         * 0, 1, 2, 3 so we have LID0, LID1, LID2 etc. - try up to LID9
> +         * and then give up.
> +         */
> +        for (i = 0; i < 10; i++)
> +          {
> +             snprintf(buff, sizeof(buff), "/proc/acpi/%s%i/%s/state",
> +                      device, i, bus);
> +             if ((f = fopen(buff, "r"))) break;
> +             f = NULL;
> +          }
> +        if (!f) return E_ACPI_LID_UNKNOWN;
> +     }
>
>    /* read the line from state file */
>    buff[0] = '\0';
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>



-- 
Michaël Bouchaud (yoz) <y...@efl.so>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to