rc: clean up compiler warnings

The get_systype(), detect_container(), detect_prefix() and detect_vm()
functions need to return "char *" instead of "const char *".
This commit is contained in:
William Hubbs 2016-01-01 13:13:28 -06:00
parent 5d3e85bc31
commit 981d2b3308
4 changed files with 13 additions and 13 deletions

View File

@ -74,8 +74,8 @@ int is_writable(const char *);
#define service_stop(service) exec_service(service, "stop");
int parse_mode(mode_t *, char *);
const char *detect_prefix(void);
const char *get_systype(void);
const char *detect_container(void);
const char *detect_vm(void);
char *detect_prefix(void);
char *get_systype(void);
char *detect_container(void);
char *detect_vm(void);
#endif

View File

@ -40,7 +40,7 @@ static void set_quiet_options(void)
_noreturn static void
show_version(void)
{
const char *systype = NULL;
char *systype = NULL;
printf("%s (OpenRC", applet);
systype = detect_container();

View File

@ -126,7 +126,7 @@ env_config(void)
char *np;
char *npp;
char *tok;
const char *sys = NULL;
char *sys = NULL;
char buffer[PATH_MAX];
/* Ensure our PATH is prefixed with the system locations first
@ -380,7 +380,7 @@ found:
return retval;
}
const char *detect_prefix(void)
char *detect_prefix(void)
{
#ifdef PREFIX
return RC_SYS_PREFIX;
@ -389,7 +389,7 @@ const char *detect_prefix(void)
#endif
}
const char *get_systype(void)
char *get_systype(void)
{
char *systype = rc_conf_value("rc_sys");
if (systype) {
@ -404,7 +404,7 @@ const char *get_systype(void)
return systype;
}
const char *detect_container(void)
char *detect_container(void)
{
char *systype = get_systype();
@ -459,7 +459,7 @@ const char *detect_container(void)
return NULL;
}
const char *detect_vm(void)
char *detect_vm(void)
{
char *systype = get_systype();

View File

@ -261,7 +261,7 @@ open_shell(void)
struct passwd *pw;
#ifdef __linux__
const char *sys = NULL;
char *sys = NULL;
sys = detect_container();
if (!sys)
@ -450,7 +450,7 @@ static void
do_sysinit()
{
struct utsname uts;
const char *sys;
char *sys;
/* exec init-early.sh if it exists
* This should just setup the console to use the correct
@ -749,7 +749,7 @@ main(int argc, char **argv)
{
const char *bootlevel = NULL;
char *newlevel = NULL;
const char *systype = NULL;
char *systype = NULL;
static RC_STRINGLIST *hotplugged_services;
static RC_STRINGLIST *stop_services;
static RC_STRINGLIST *start_services;