Bug 706928

Summary: fsync section asks the programmer to truncate file before reading from it
Product: Red Hat Enterprise Linux 6 Reporter: Jan Kundrát <jkt>
Component: doc-Power_Management_GuideAssignee: Jack Reed <jreed>
Status: CLOSED CURRENTRELEASE QA Contact: ecs-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0CC: dayleparker, ineilsen, jskarvad, pbokoc
Target Milestone: rcKeywords: Documentation
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 767869 (view as bug list) Environment:
Last Closed: 2012-06-22 00:15:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 767869    

Description Jan Kundrát 2011-05-23 13:57:39 UTC
I suspect that the documentation at [1] has an error in the second code snippet, the following line:

open("/.kde/myconfig", O_WRONLY|O_TRUNC|O_CREAT);

Instead of reading the configuration from source and only then writing the second one, the original file is truncated before reading from it.

I suspect it should be changed to *read* from that file.

[1] http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Power_Management_Guide/Developer_Tips-Fsync.html

Comment 3 Jack Reed 2011-12-12 01:24:50 UTC
Thanks for pointing this out, Jan. I've changed 'open' to 'read' in the second sample config file ready for the 6.3 version of the guide.

Comment 10 IanNeilsen 2011-12-19 00:44:03 UTC
QE verified in version

Red_Hat_Enterprise_Linux-Power_Management_Guide-6-en-US-1.0-13

[verified]

Comment 11 Dayle Parker 2012-06-22 00:15:00 UTC
This bug is now fixed and available as part of the Red Hat Enterprise Linux 6.3 release on http://docs.redhat.com/.

Setting to CLOSED > CURRENTRELEASE.