API change for FS (.lock = .exclusive).

This commit is contained in:
Philippe Pittoli 2023-06-03 03:27:56 +02:00
parent efd7584ce5
commit 8ca93de58a

View File

@ -245,7 +245,7 @@ pub const Context = struct {
// While the program is running, the lock is enabled. // While the program is running, the lock is enabled.
// Once the program stops (even if it crashes), the lock is then disabled. // Once the program stops (even if it crashes), the lock is then disabled.
// Quit if the lock is still active. // Quit if the lock is still active.
const lock_opts = .{ .lock = .Exclusive, .lock_nonblocking = true }; const lock_opts = .{ .lock = .exclusive, .lock_nonblocking = true };
_ = std.fs.createFileAbsolute(lock, lock_opts) catch |err| { _ = std.fs.createFileAbsolute(lock, lock_opts) catch |err| {
log.err("cannot init server at {s}, lock {s} is causing a problem: {any}", .{ path, lock, err }); log.err("cannot init server at {s}, lock {s} is causing a problem: {any}", .{ path, lock, err });
log.err("you may have lauched the service twice.", .{}); log.err("you may have lauched the service twice.", .{});