Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
274b9199
Commit
274b9199
authored
Dec 29, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main: use g_setenv() instead of setenv()
Removed the fallback setenv() implementation for solaris.
parent
65171262
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
43 deletions
+1
-43
configure.ac
configure.ac
+0
-1
main.c
src/main.c
+1
-42
No files found.
configure.ac
View file @
274b9199
...
@@ -360,7 +360,6 @@ AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
...
@@ -360,7 +360,6 @@ AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)
AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)
AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",)
AC_CHECK_LIB(m,exp,MPD_LIBS="$MPD_LIBS -lm",)
AC_CHECK_FUNCS(setenv)
# Check for pkg-config before using it
# Check for pkg-config before using it
PKG_PROG_PKG_CONFIG
PKG_PROG_PKG_CONFIG
...
...
src/main.c
View file @
274b9199
...
@@ -71,47 +71,6 @@
...
@@ -71,47 +71,6 @@
#include <locale.h>
#include <locale.h>
#endif
#endif
/*
* from git-1.3.0, needed for solaris
*/
#ifndef HAVE_SETENV
static
int
setenv
(
const
char
*
name
,
const
char
*
value
,
int
replace
)
{
int
out
;
size_t
namelen
,
valuelen
;
char
*
envstr
;
if
(
!
name
||
!
value
)
return
-
1
;
if
(
!
replace
)
{
char
*
oldval
=
NULL
;
oldval
=
getenv
(
name
);
if
(
oldval
)
return
0
;
}
namelen
=
strlen
(
name
);
valuelen
=
strlen
(
value
);
envstr
=
xmalloc
((
namelen
+
valuelen
+
2
));
if
(
!
envstr
)
return
-
1
;
memcpy
(
envstr
,
name
,
namelen
);
envstr
[
namelen
]
=
'='
;
memcpy
(
envstr
+
namelen
+
1
,
value
,
valuelen
);
envstr
[
namelen
+
valuelen
+
1
]
=
0
;
out
=
putenv
(
envstr
);
/* putenv(3) makes the argument string part of the environment,
* and changing that string modifies the environment --- which
* means we do not own that storage anymore. Do not free
* envstr.
*/
return
out
;
}
#endif
/* HAVE_SETENV */
static
void
changeToUser
(
void
)
static
void
changeToUser
(
void
)
{
{
ConfigParam
*
param
=
getConfigParam
(
CONF_USER
);
ConfigParam
*
param
=
getConfigParam
(
CONF_USER
);
...
@@ -148,7 +107,7 @@ static void changeToUser(void)
...
@@ -148,7 +107,7 @@ static void changeToUser(void)
/* this is needed by libs such as arts */
/* this is needed by libs such as arts */
if
(
userpwd
->
pw_dir
)
{
if
(
userpwd
->
pw_dir
)
{
setenv
(
"HOME"
,
userpwd
->
pw_dir
,
1
);
g_setenv
(
"HOME"
,
userpwd
->
pw_dir
,
true
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment