aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-06-27 10:39:49 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-27 11:14:40 +0200
commitc25b44d640f709599e3c484a458ae452d99108e1 (patch)
tree9243fa06182c1af7ddb329ad71981eec4ad58505
parentb09e4960be0034716bd9afeb647c17203967d769 (diff)
downloadguix-c25b44d640f709599e3c484a458ae452d99108e1.tar
guix-c25b44d640f709599e3c484a458ae452d99108e1.tar.gz
accounts: Use 'fsync' instead of 'fdatasync'.
* gnu/build/accounts.scm (catch-ENOSYS): Remove. (database-writer): Use 'fsync' instead of 'fdatasync'.
-rw-r--r--gnu/build/accounts.scm14
1 files changed, 1 insertions, 13 deletions
diff --git a/gnu/build/accounts.scm b/gnu/build/accounts.scm
index b90149565f..5094456ab1 100644
--- a/gnu/build/accounts.scm
+++ b/gnu/build/accounts.scm
@@ -19,7 +19,6 @@
(define-module (gnu build accounts)
#:use-module (guix records)
#:use-module (guix combinators)
- #:use-module ((guix build syscalls) #:select (fdatasync))
#:use-module (gnu system accounts)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
@@ -231,14 +230,6 @@ each field."
;; grab this lock with 'with-file-lock' when they access the databases.
"/etc/.pwd.lock")
-(define-syntax-rule (catch-ENOSYS exp)
- (catch 'system-error
- (lambda () exp)
- (lambda args
- (if (= ENOSYS (system-error-errno args))
- #f
- (apply throw args)))))
-
(define (database-writer file mode entry->string)
(lambda* (entries #:optional (file-or-port file))
"Write ENTRIES to FILE-OR-PORT. When FILE-OR-PORT is a file name, write
@@ -259,10 +250,7 @@ to it atomically and set the appropriate permissions."
(chmod port mode)
(write-entries port)
- ;; XXX: When booting with the statically-linked Guile,
- ;; 'fdatasync' is unavailable.
- (catch-ENOSYS (fdatasync port))
-
+ (fsync port)
(close-port port)
(rename-file template file-or-port))
(lambda ()