dma: prevent races from sharing fd between children
authorSimon Schubert <simon.schubert@epfl.ch>
Thu, 9 Jul 2009 21:24:35 +0000 (23:24 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Thu, 16 Jul 2009 14:13:06 +0000 (16:13 +0200)
commit4466b9c28dec3932614c842bd17d3a38668f1dbb
tree8d5fa16b75c3a5f9d1fb46bfbd02180564c1fcec
parent431e1ddf2ebaba59acf98e2d50a5b8f595b22819
dma: prevent races from sharing fd between children

On fork, fds are shared between children.  If two processes work on
different recipients, but on the same queue file, they might get
confused when the fd (and thus the offset) is shared.  Prevent this by
re-opening the queue file after fork.

Reported-by: Daniel Roethlisberger <daniel@roe.ch>
libexec/dma/dma.c