#559 closed enhancement (fixed)

Add O_SYNC to open() when writing XML configuration

Reported by: silasdb@… Owned by:
Priority: normal Milestone:
Component: BitlBee Version: devel
Keywords: xml configuration Cc:
IRC client+version: Client-independent Operating System: NetBSD
OS version/distro: 5.0


The XML configuration can get corrupted due to a system crash. Is it worth to pass the O_SYNC flag (or maybe O_DSYNC)?

The attached patch - very simple! - adds the O_SYNC flag to the open(2) call in xml_save(), in storage_xml.c.

Attachments (1)

storage_xml_O_SYNC.diff (453 bytes) - added by silasdb@… at 2010-01-30T13:26:05Z.
Add O_SYNC flag to the open(2) call in the

Download all attachments as: .zip

Change History (3)

Changed at 2010-01-30T13:26:05Z by silasdb@…

Attachment: storage_xml_O_SYNC.diff added

Add O_SYNC flag to the open(2) call in the

comment:1 Changed at 2010-01-30T14:02:52Z by silasdb@…

Actually, it might be better to call fsync(2) just before close(2) instead of passing O_SYNC to open(2).

comment:2 Changed at 2010-04-13T22:36:41Z by wilmer

Resolution: fixed
Status: newclosed

Modify Ticket

as closed The ticket will remain with no owner.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.