Skip to content

Commit

Permalink
scdaemon: support --homedir
Browse files Browse the repository at this point in the history
  • Loading branch information
alonbl committed Apr 18, 2017
1 parent 09c3b2e commit b9a0fea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Copyright (c) 2006-2017 Alon Bar-Lev <alon.barlev@gmail.com>

????-??-?? - Version 0.7.6

* Add --homedir parameter.

2017-03-01 - Version 0.7.5

Expand Down
9 changes: 8 additions & 1 deletion scdaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ int main (int argc, char *argv[])
OPT_CSH,
OPT_OPTIONS,
OPT_NO_DETACH,
OPT_HOMEDIR,
OPT_LOG_FILE,
OPT_VERSION,
OPT_HELP
Expand All @@ -743,6 +744,7 @@ int main (int argc, char *argv[])
{ "csh", no_argument, NULL, OPT_CSH },
{ "options", required_argument, NULL, OPT_OPTIONS },
{ "no-detach", no_argument, NULL, OPT_NO_DETACH },
{ "homedir", required_argument, NULL, OPT_HOMEDIR },
{ "log-file", required_argument, NULL, OPT_LOG_FILE },
{ "version", no_argument, NULL, OPT_VERSION },
{ "help", no_argument, NULL, OPT_HELP },
Expand Down Expand Up @@ -824,6 +826,9 @@ int main (int argc, char *argv[])
case OPT_NO_DETACH:
no_detach = 1;
break;
case OPT_HOMEDIR:
home_dir = strdup (optarg);
break;
case OPT_LOG_FILE:
base_argc++;
log_file = strdup (optarg);
Expand Down Expand Up @@ -871,7 +876,9 @@ int main (int argc, char *argv[])
}
#endif

home_dir = get_home_dir ();
if (home_dir == NULL) {
home_dir = get_home_dir ();
}

if (config_file == NULL) {
if ((config_file = (char *)malloc (strlen (home_dir) + strlen (default_config_file)+2)) == NULL) {
Expand Down

0 comments on commit b9a0fea

Please sign in to comment.