alsa-utils/alsactl
Takashi Iwai c53f7cd038 alsactl: Fix race at creating a lock file
A race at creating a lock file in state_lock() was discovered
recently: namely, between the first open(O_RDWR) and the second
open(O_RDWR|O_CREAT|O_EXCL) calls, another alsactl invocation may
already create a lock file, then the second open() will return EEXIST,
which isn't handled properly and treated as a fatal error.

In this patch, we check EEXIST case and try again open() with O_RDWR.
This must succeed usually, and if it fails, handle finally as the
fatal error.

BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1179904
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11 23:46:23 +01:00
..
init alsactl: 00main - fix typo in goto label 2020-10-13 17:30:15 +02:00
.gitignore alsactl: systemd and udev hookup 2010-11-23 10:42:35 +01:00
90-alsa-restore.rules.in alsactl: Fixup test for mydatadir/sbindir 2014-06-13 11:54:45 +02:00
alsa-restore.service.in alsactl: Only start restore service when asoundrc file exists 2017-12-14 11:24:40 +01:00
alsa-state.service.in alsactl: Move systemd unit start-up from basic.target to sound.target 2017-10-06 14:32:16 +02:00
alsactl.1 alsactl: add new -U argument text to man page 2020-10-06 13:05:12 +02:00
alsactl.c alsactl: init - add -U option to disable UCM based init 2020-10-06 13:03:03 +02:00
alsactl.h alsactl: init - add -U option to disable UCM based init 2020-10-06 13:03:03 +02:00
alsactl_init.xml alsactl: Read only *.conf files when a directory is passed via INCLUDE 2012-06-14 16:06:42 +02:00
daemon.c alsactl: daemon.c - fix gcc warning in write_pid_file() 2020-05-14 16:49:06 +02:00
init_parse.c alsactl: init - add -U option to disable UCM based init 2020-10-06 13:03:03 +02:00
init_sysdeps.c alsa-utils check if __USE_BSD is defined before compiling "BSD functions" 2008-12-08 11:55:27 +01:00
init_sysfs.c alsactl: sysfs - add /sys/kernel/uevent_seqnum check to init 2019-11-25 18:01:32 +01:00
init_ucm.c alsactl: ucm - rename _once command to _boot command 2020-05-25 19:21:25 +02:00
init_utils_run.c Initial 'alsactl init' implementation 2008-07-31 15:45:08 +02:00
init_utils_string.c Fix misc compile warnings in alsactl 2009-02-18 15:34:57 +01:00
list.h Initial 'alsactl init' implementation 2008-07-31 15:45:08 +02:00
lock.c alsactl: Fix race at creating a lock file 2020-12-11 23:46:23 +01:00
Makefile.am alsactl: add initial support for UCM init 2020-05-14 18:19:20 +02:00
monitor.c alsactl: avoid needless wakeups in monitor loop. 2020-04-14 15:34:00 +02:00
state.c alsactl: add -D argument to execute also the UCM defaults section 2020-05-14 19:34:18 +02:00
utils.c alsactl: fix the syslog message - add : delimiter after function:line 2020-06-20 08:47:01 +02:00