Attachments you submit will be routed for moderation. If you have an account, please log in first.

Ticket #1656: 0001-Removes-the-use-of-O_SYNC-on-logs.patch

File 0001-Removes-the-use-of-O_SYNC-on-logs.patch, 1.1 KB (added by quozl, 3 years ago)

Short patch that removes O_SYNC with no option to enable it for debugging without editing source. Following a discussion between silbe and others on #sugar on 2010-03-08/09

  • src/sugar/activity/activityfactory.py

    From 5b0dfe0bafdb9f5fde2133524bfeb8ad29c2ff4c Mon Sep 17 00:00:00 2001
    From: James Cameron <quozl@laptop.org>
    Date: Tue, 9 Mar 2010 09:29:30 +1100
    Subject: [PATCH] Removes the use of O_SYNC on logs
    
    With O_SYNC on open of log files, on systems with slow filesystem random
    write performance, there is random activity startup time.
    
    http://bugs.sugarlabs.org/ticket/1656
    ---
     src/sugar/activity/activityfactory.py |    3 +--
     1 files changed, 1 insertions(+), 2 deletions(-)
    
    diff --git a/src/sugar/activity/activityfactory.py b/src/sugar/activity/activityfactory.py
    index eda7d9a..c12630e 100644
    a b  
    149149    while True: 
    150150        path = env.get_logs_path('%s-%s.log' % (activity.get_bundle_id(), i)) 
    151151        try: 
    152             fd = os.open(path, os.O_EXCL | os.O_CREAT \ 
    153                              | os.O_SYNC | os.O_WRONLY, 0644) 
     152            fd = os.open(path, os.O_EXCL | os.O_CREAT | os.O_WRONLY, 0644) 
    154153            f = os.fdopen(fd, 'w', 0) 
    155154            return (path, f) 
    156155        except OSError, e: