Hi,

next time, i will test on an affected machine :-)
This is already checked in:

Index: s2ram-x86.c
===================================================================
RCS file: /cvsroot/suspend/suspend/s2ram-x86.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -p -U5 -r1.6 -r1.7
--- s2ram-x86.c 19 Jul 2007 13:28:47 -0000      1.6
+++ s2ram-x86.c 31 Jul 2007 12:32:41 -0000      1.7
@@ -69,20 +69,23 @@ void identify_machine(void)
 }
 
 static int set_acpi_video_mode(int mode)
 {
        unsigned long acpi_video_flags;
-       FILE *f = fopen("/proc/sys/kernel/acpi_video_flags", "rw");
+       FILE *f = fopen("/proc/sys/kernel/acpi_video_flags", "r");
        if (!f) {
                printf("/proc/sys/kernel/acpi_video_flags does not exist; you 
need a kernel >=2.6.16.\n");
                return S2RAM_FAIL;
        }
        /* read the old setting from /proc */
        if (fscanf(f, "%ld", &acpi_video_flags) != 1) {
                printf("/proc/sys/kernel/acpi_video_flags format is invalid\n");
                return S2RAM_FAIL;
        }
+       /* rewind() seems not to work on /proc files, so close and reopen it */
+       fclose(f);
+       f = fopen("/proc/sys/kernel/acpi_video_flags", "w");
        /* mask out bits 0 and 1 */
        acpi_video_flags = acpi_video_flags & (~0UL - S3_BIOS - S3_MODE);
        fprintf(f, "%ld", acpi_video_flags | mode);
        fflush(f);
        fclose(f);

This caused the acpi_video_flags to not get written at all, so if you get
reports about no longer working suspend, make sure these users use the
latest code.
-- 
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to