Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Cannot write to zsystem flock's descriptor
- X-seq: zsh-workers 40680
- From: Sebastian Gniazdowski <psprint3@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Cannot write to zsystem flock's descriptor
- Date: Wed, 01 Mar 2017 02:49:45 -0800
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=bqMOyCN8krY4lNaO1V1ESf+j0M0=; b=yNT00OmsHfgo9hfYq3F6X pLxQn7Xia6YnYuxiuKyjye7F8wrp8cEqU1e2+P7RZu2T6ea8ZSITdYoZAIj4FG2+ VacpKSsVtG9QrF9F2iGmCjkaQ0IqS+1qP+9GpQrG1hP6OtQCxL9I7+99Xtkj+hVH ip5Q6GRRSt2VfahtibJqA4=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=smtpout; bh=bqMOyCN8krY4lNaO1V1ESf+j0 M0=; b=GR6QeeGwN3DuJiP5VIazZbO1OaAe7goAAvuRv/BG8huo5rKJ4G/VQGeD8 mA7AFnm3g1EQ0axPgUacUOamh652BessZmaf3P1+Doy2ZccicMis+3IWdtbqSoIM BPx5PaoornxoVoVDLv+H8l9HuthFdhSKy2POa+PbMjAuV9Hfms=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hello,
# echo "test" > file
# zsystem flock -t 0 -f MY_FD "file"; echo $?
0
# echo a>&${MY_FD}
zsh: 11: bad file descriptor
# exec {MY_FD}>&-
(works, lock also works)
I've added debug logs to system.c and there is:
Read-write flags, 2 (O_RDWR) | 131072 (O_NOCTTY) = 131074
Before move fdflags 0
After move fdflags 0
After cloexec fdflags 1
lck.l_type RD:1, WR:3, is:3
So it looks good. When locking via "flock" util-linux program I can
write to the FD. What could it be?
if ((flock_fd = open(unmeta(args[0]), flags)) < 0) {
flags are like first line of debug message. I think it's open() that
matters.
--
Sebastian Gniazdowski
psprint3@xxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author