mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-28 14:17:57 -04:00
Fix ret/iret variables usage
This commit is contained in:
parent
8feeecd895
commit
662ba32d35
20
src/main.c
20
src/main.c
@ -95,9 +95,9 @@ daemonize(int background, char *pidfile)
|
|||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
pid_t childpid;
|
pid_t childpid;
|
||||||
pid_t ret;
|
pid_t pid_ret;
|
||||||
int fd;
|
int fd;
|
||||||
int iret;
|
int ret;
|
||||||
char *runas;
|
char *runas;
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
|
|
||||||
@ -153,8 +153,8 @@ daemonize(int background, char *pidfile)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = setsid();
|
pid_ret = setsid();
|
||||||
if (ret == (pid_t) -1)
|
if (pid_ret == (pid_t) -1)
|
||||||
{
|
{
|
||||||
DPRINTF(E_FATAL, L_MAIN, "setsid() failed: %s\n", strerror(errno));
|
DPRINTF(E_FATAL, L_MAIN, "setsid() failed: %s\n", strerror(errno));
|
||||||
|
|
||||||
@ -186,24 +186,24 @@ daemonize(int background, char *pidfile)
|
|||||||
|
|
||||||
if (pw)
|
if (pw)
|
||||||
{
|
{
|
||||||
iret = initgroups(runas, pw->pw_gid);
|
ret = initgroups(runas, pw->pw_gid);
|
||||||
if (iret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
DPRINTF(E_FATAL, L_MAIN, "initgroups() failed: %s\n", strerror(errno));
|
DPRINTF(E_FATAL, L_MAIN, "initgroups() failed: %s\n", strerror(errno));
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
iret = setgid(pw->pw_gid);
|
ret = setgid(pw->pw_gid);
|
||||||
if (iret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
DPRINTF(E_FATAL, L_MAIN, "setgid() failed: %s\n", strerror(errno));
|
DPRINTF(E_FATAL, L_MAIN, "setgid() failed: %s\n", strerror(errno));
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
iret = setuid(pw->pw_uid);
|
ret = setuid(pw->pw_uid);
|
||||||
if (iret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
DPRINTF(E_FATAL, L_MAIN, "setuid() failed: %s\n", strerror(errno));
|
DPRINTF(E_FATAL, L_MAIN, "setuid() failed: %s\n", strerror(errno));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user