From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-users-return-23678-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id b578751a for ; Mon, 24 Sep 2018 03:04:19 +0000 (UTC) Received: (qmail 20668 invoked by alias); 24 Sep 2018 03:04:01 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23678 Received: (qmail 3909 invoked by uid 1010); 24 Sep 2018 03:04:01 -0000 X-Qmail-Scanner-Diagnostics: from mail-pl1-f178.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.214.178):SA:0(-1.7/5.0):. Processed in 3.371961 secs); 24 Sep 2018 03:04:01 -0000 X-Envelope-From: lilydjwg@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:disposition-notification-to :user-agent; bh=Ih0H+3Xfi63/7KAiwaGF6xWPNaWoeo72Wq/m0NZ46eE=; b=PfPoDBQhQHCf6dlVxh0IuPTnMwIA9T8Ym/QE1odWUefn+Ee2Y5MZCFXSOH2KVbu0Kb 52i65fG2qARPCwc7uZGY+4hubmKcwUGpHWPyFR1VALdYL8ZxMBSy1if/7FFpZIKgO/G0 mYkKyUW83HJoEYaWW8O8tCvhOTT7CXWzQ8EkeRJnTQj9n7qWiu50vlXzrizQi6sLcQed 7UBOqwIFEMGlvcuBzzYP6Lq14KZiKjJf87rKrJ7ZLi3jt431tj3+Q4wqdJxvlJGfFGQ6 HtDoUUTvz7TEfQgN1GVY0g3i/094G0yDCa4cMO15PzeIwuKf6Lrs8Zy/LOo4DJ3R3Xvf QuRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to :disposition-notification-to:user-agent; bh=Ih0H+3Xfi63/7KAiwaGF6xWPNaWoeo72Wq/m0NZ46eE=; b=ltz3ltw8PoC8zBPqpQZNJRH9L5NAJDeiYp2HtIbZRwG3LsDft8slqAQ63xwgSV/VSM Ccr61u5UGo0OriX65mw3BdZjq1Xws1ZuKB1iqF0/cihkQ7QwhqEKdYBILAfi1M2Ky/FB Z2CU4pBn2mYui3PqPoyTGemY/xL2K2PzCC9hVRpVE/VtSOYiIHEpg+VQPDpqCkbFheU8 35Zyec74rFqb39S6894pVSS9OOKmBs/a2BP66mHt6q4Xn04MLZ8ibmLrRQKkWk2bhbT3 BKZN68b25mGyBQwd7BGjEOXhGQLsDpdxUgCvA3yizCsPpKnObgTuH/A23eq9Az12Ns2z 7awA== X-Gm-Message-State: ABuFfohBt91J6O7IavD9N30iSsjo5DXlfjxcTprYHJWhI66EtxtCcZG5 G3+FwxM5jnSykvi/Y//yt10= X-Google-Smtp-Source: ACcGV606n8aZm7f8kq2ERpWHiIxqZYQ9/8E0odeLVxaW+u805KGUIvVGgZRy2WotSkDPjMmS9hjFiA== X-Received: by 2002:a17:902:7287:: with SMTP id d7-v6mr8740808pll.54.1537758235146; Sun, 23 Sep 2018 20:03:55 -0700 (PDT) Date: Mon, 24 Sep 2018 11:03:20 +0800 From: lilydjwg To: Daniel Shahaf Cc: zsh-users@zsh.org Subject: Re: No fsync on history file? I lost my history Message-ID: <20180924030320.GA25143@lilyforest.localdomain> References: <20180923085246.GA19251@lilyforest.localdomain> <1537709747.103981.1517680056.72C7A43E@webmail.messagingengine.com> <20180923142255.GA4931@lilyforest.localdomain> <1537714011.118073.1517716184.0B2E8824@webmail.messagingengine.com> <20180923152546.GA6201@lilyforest.localdomain> <1537717517.130522.1517748104.07A63DB4@webmail.messagingengine.com> <20180923194018.GA18586@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180923194018.GA18586@zira.vinc17.org> User-Agent: Mutt/1.10.1 (2018-07-13) On 2018-09-23 15:45:17 +0000, Daniel Shahaf wrote: > Yes, I understand that fflush(3) must be called in order to flush data > from libc's buffers into kernel buffers, which fsync(2) will later flush > to disk. My question was whether the fflush() call being added was > redundant because of the existing call on line 2927. It would be odd > to have two fflush() calls in a row without fwrite() between them; and > to have only one of them update lasthist. Oh sorry I misread your message. The fflush() above isn't sufficient because it's not called in my case. I don't know when the "if" will be true but calling two fflush() is better than calling none. Maybe calling only once above them is better, but this will leave the fflush() a little far from where it's needed. On Sun, Sep 23, 2018 at 09:40:19PM +0200, Vincent Lefevre wrote: > But the first one is in a "if", thus might have not been called. Or > there is an inconsistency in the conditions, which should be fixed. What does HFILE_USE_OPTIONS mean? This seems to be unset when zsh exits. -- Best regards, lilydjwg