]> git.scottworley.com Git - tattlekey/commit
server: Bind port before messing with log files as a lock
authorScott Worley <scottworley@scottworley.com>
Tue, 10 Oct 2023 23:57:22 +0000 (16:57 -0700)
committerScott Worley <scottworley@scottworley.com>
Wed, 11 Oct 2023 01:50:46 +0000 (18:50 -0700)
commit5f5768318f897a20464ca177b5de64157afe0938
tree9dba2df3c5aaee52456b63e566eadf6949df113e
parent0d4f2aa67ed92add9c371a49cc45daad8e529301
server: Bind port before messing with log files as a lock

Rather than messing with flock, fnctl-F_SETLK, etc., just bind the port
before touching the log file & let the failure to bind the port keep
two instances of the server from stepping on each others' log i/o.
server/src/main.rs