X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=audioc.c;h=83b1930c732ef1fbecfefb6441672eee5fafad80;hb=a643d679435592a3a02b3a4e51ddb5df28a4266e;hp=d6c14cbcf7245a3a7db4bb3f86cf7e35efb8384b;hpb=15e3068cd0b95a7ae37f8edc2eceea3b2a3a49a9;p=paraslash.git diff --git a/audioc.c b/audioc.c index d6c14cbc..83b1930c 100644 --- a/audioc.c +++ b/audioc.c @@ -175,7 +175,7 @@ static int audioc_post_monitor(struct sched *s, void *context) ret = recv_bin_buffer(at->fd, buf, bufsize); PARA_DEBUG_LOG("recv: %d\n", ret); if (ret == 0) - ret = -E_AUDIOC_EOF; + ret = -E_EOF; if (ret < 0) goto out; btr_add_output(buf, ret, at->btrn); @@ -231,7 +231,6 @@ close: __noreturn static void interactive_session(void) { int ret; - char *history_file; struct sigaction act; struct i9e_client_info ici = { .fds = {0, 1, 2}, @@ -242,16 +241,9 @@ __noreturn static void interactive_session(void) }; PARA_NOTICE_LOG("\n%s\n", version_text("audioc")); - if (OPT_GIVEN(HISTORY_FILE)) - history_file = para_strdup(OPT_STRING_VAL(HISTORY_FILE)); - else { - char *home = para_homedir(); - history_file = make_message("%s/.paraslash/audioc.history", - home); - free(home); - } - ici.history_file = history_file; - + ici.history_file = OPT_GIVEN(HISTORY_FILE)? + para_strdup(OPT_STRING_VAL(HISTORY_FILE)) : + make_message("%s/audioc.history", get_confdir()); act.sa_handler = i9e_signal_dispatch; sigemptyset(&act.sa_mask); act.sa_flags = 0; @@ -268,7 +260,7 @@ __noreturn static void interactive_session(void) i9e_close(); para_log = stderr_log; out: - free(history_file); + free(ici.history_file); free(socket_name); if (ret < 0) PARA_ERROR_LOG("%s\n", para_strerror(-ret));