Opened 10 years ago

Closed 10 years ago

#6830 closed defect (fixed)

mythlcdserver inherits mythfrontend's open file descriptors

Reported by: foobum@… Owned by: Isaac Richards
Priority: trivial Milestone: 0.22
Component: MythTV - General Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

This only causes real problems if mythlcdserver happens to be exec'd whilst mythfrontend has the sound card open, in which case the next time mythfrontend attempts to open the card it finds it's 'busy'.

Attached patch sets the close-on-exec flag on all open fds before mythfrontend forks.

Attachments (1)

lcd_cloexec.patch (1.1 KB) - added by foobum@… 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by foobum@…

Attachment: lcd_cloexec.patch added

comment:1 Changed 10 years ago by paulh

Milestone: unknown0.22
Status: newinfoneeded_new
Version: unknownhead

Can you try changing the system() call that starts mythlcdserver to mythsystem() and see if that fixes things for you.

IIRC mythsystem() will close all open file descriptors except stdout/stderr which would be a cleaner solution if it works.

comment:2 Changed 10 years ago by foobum@…

A quick look reveals that myth_system() would work fine.

comment:3 Changed 10 years ago by paulh

Resolution: fixed
Status: infoneeded_newclosed

(In [21278]) When mythlcdserver is started automatically by mythfrontend or mythwelcome make sure any file descriptors inherited by the child process are closed. Fixes #6830.

It would have been nice to use myth_system() but that's not possible because of problems with circular dependencies.

Note: See TracTickets for help on using tickets.