#include <regex.h>
#include <signal.h>
-#include <sys/time.h>
#include <sys/types.h>
#include <osl.h>
localtime_r(&nmmd->mtime, &mtime_tm);
strftime(mtime, 29, "%b %d %Y", &mtime_tm);
}
- gettimeofday(¤t_time, NULL);
+ clock_get_realtime(¤t_time);
/*
* The calls to WRITE_STATUS_ITEM() below never fail because
* b->max_size is zero (unlimited), see para_printf(). However, clang
free(info);
}
ut = get_server_uptime_str(now);
- ret = xasprintf(&msg, "version: " GIT_VERSION "\n"
+ ret = xasprintf(&msg,
+ "version: %s\n"
"up: %s\nplayed: %u\n"
"server_pid: %d\n"
"afs_pid: %d\n"
"current loglevel: %s\n"
"supported audio formats: %s\n"
"%s",
+ version_git(),
ut, mmd->num_played,
(int)getppid(),
(int)mmd->afs_pid,
mmd->num_commands,
mmd->num_connects,
conf.loglevel_arg,
- SERVER_AUDIO_FORMATS,
+ AUDIO_FORMAT_HANDLERS,
sender_info
);
mutex_unlock(mmd_mutex);
if (cc->argc != 1)
return -E_COMMAND_SYNTAX;
- msg = VERSION_TEXT("server") "built: " BUILD_DATE "\n" UNAME_RS
- ", " CC_VERSION "\n";
- len = strlen(msg);
- return send_sb(&cc->scc, msg, len, SBD_OUTPUT, true);
+ len = xasprintf(&msg, "%s", version_text("server"));
+ return send_sb(&cc->scc, msg, len, SBD_OUTPUT, false);
}
#define EMPTY_STATUS_ITEMS \
*/
static unsigned empty_status_items(int parser_friendly, char **result)
{
- static char *esi;
- static unsigned len;
-
- if (esi)
- goto out;
+ char *esi;
+ unsigned len;
if (parser_friendly)
len = xasprintf(&esi,
EMPTY_STATUS_ITEMS
#undef ITEM
);
-out:
*result = esi;
return len;
}
{
int i, ret;
struct misc_meta_data tmp, *nmmd = &tmp;
- char *s, *esi = NULL;
+ char *s;
int32_t num = 0;
int parser_friendly = 0;
if (ret < 0)
goto out;
if (nmmd->vss_status_flags & VSS_NEXT) {
+ char *esi;
ret = empty_status_items(parser_friendly, &esi);
- ret = send_sb(&cc->scc, esi, ret, SBD_OUTPUT, true);
+ ret = send_sb(&cc->scc, esi, ret, SBD_OUTPUT, false);
if (ret < 0)
goto out;
} else
goto out;
}
out:
- free(esi);
return ret;
}