mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-22 01:40:08 -05:00
Merge a4a54ad481 into 5f7fe33002
This commit is contained in:
commit
a0b5c5ee09
1 changed files with 5 additions and 5 deletions
|
|
@ -183,7 +183,7 @@ static int parse_args(char ***argv, int argc, const char *cmd)
|
||||||
*/
|
*/
|
||||||
int uc_mgr_exec(const char *prog)
|
int uc_mgr_exec(const char *prog)
|
||||||
{
|
{
|
||||||
pid_t p, f;
|
pid_t p;
|
||||||
int err = 0, status;
|
int err = 0, status;
|
||||||
char bin[PATH_MAX];
|
char bin[PATH_MAX];
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
|
|
@ -239,7 +239,7 @@ int uc_mgr_exec(const char *prog)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p == 0) {
|
if (p == 0) {
|
||||||
f = open("/dev/null", O_RDWR);
|
int f = open("/dev/null", O_RDWR);
|
||||||
if (f == -1) {
|
if (f == -1) {
|
||||||
snd_error(UCM, "pid %d cannot open /dev/null for redirect %s -- %s",
|
snd_error(UCM, "pid %d cannot open /dev/null for redirect %s -- %s",
|
||||||
getpid(), prog, strerror(errno));
|
getpid(), prog, strerror(errno));
|
||||||
|
|
@ -261,7 +261,7 @@ int uc_mgr_exec(const char *prog)
|
||||||
closefrom(3);
|
closefrom(3);
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
pid_t maxfd = sysconf(_SC_OPEN_MAX);
|
long maxfd = sysconf(_SC_OPEN_MAX);
|
||||||
for (f = 3; f < maxfd; f++)
|
for (f = 3; f < maxfd; f++)
|
||||||
close(f);
|
close(f);
|
||||||
}
|
}
|
||||||
|
|
@ -287,8 +287,8 @@ int uc_mgr_exec(const char *prog)
|
||||||
setpgid(p, p);
|
setpgid(p, p);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
f = waitpid(p, &status, 0);
|
pid_t r = waitpid(p, &status, 0);
|
||||||
if (f == -1) {
|
if (r == -1) {
|
||||||
if (errno == EAGAIN)
|
if (errno == EAGAIN)
|
||||||
continue;
|
continue;
|
||||||
err = -errno;
|
err = -errno;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue