Skip to content

Commit

Permalink
Add git commit and dirty status if available. Slightly reorder the de…
Browse files Browse the repository at this point in the history
…bug messages at the start.
  • Loading branch information
mikebrady committed Apr 15, 2019
1 parent c985ee6 commit 1b1348e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
10 changes: 8 additions & 2 deletions common.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
#include <syslog.h>
#endif

#include "build_details.h"

#ifdef CONFIG_ALSA
void set_alsa_out_dev(char *);
#endif
Expand Down Expand Up @@ -1282,11 +1284,15 @@ char *get_version_string() {
char *version_string = malloc(1024);
if (version_string) {
strcpy(version_string, PACKAGE_VERSION);
if (strlen(GITDESCRIPTION)) {
strcat(version_string, "-");
strcat(version_string, GITDESCRIPTION);
}
#ifdef CONFIG_LIBDAEMON
strcat(version_string, "-libdaemon");
strcat(version_string, "-libdaemon");
#endif
#ifdef CONFIG_MBEDTLS
strcat(version_string, "-mbedTLS");
strcat(version_string, "-mbedTLS");
#endif
#ifdef CONFIG_POLARSSL
strcat(version_string, "-PolarSSL");
Expand Down
24 changes: 13 additions & 11 deletions shairport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,19 @@ int main(int argc, char **argv) {
// make sure the program can create files that group and world can read
umask(S_IWGRP | S_IWOTH);


/* print out version */

char *version_dbs = get_version_string();
if (version_dbs) {
debug(1, "software version: \"%s\"", version_dbs);
free(version_dbs);
} else {
debug(1, "can't print the version information!");
}

debug(1, "log verbosity is %d.", debuglev);

config.output = audio_get_output(config.output_name);
if (!config.output) {
audio_ls_outputs();
Expand Down Expand Up @@ -1555,18 +1568,7 @@ int main(int argc, char **argv) {
BUFFER_FRAMES * 352 - 22050);
}

/* print out version */

char *version_dbs = get_version_string();
if (version_dbs) {
debug(1, "software version: \"%s\"", version_dbs);
free(version_dbs);
} else {
debug(1, "can't print the version information!");
}

/* Print out options */
debug(1, "log verbosity is %d.", debuglev);
debug(1, "disable resend requests is %s.", config.disable_resend_requests ? "on" : "off");
debug(1, "diagnostic_drop_packet_fraction is %f. A value of 0.0 means no packets will be dropped "
"deliberately.",
Expand Down

0 comments on commit 1b1348e

Please sign in to comment.