]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audioc.c
Consult $HOME rather than calling getpwuid(),
[paraslash.git] / audioc.c
index 2506c3f8ea6149df47bc84fcb6e5b1b608e70cc5..16155d4c02a191e776a678f1ddd402935d7922b8 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -107,6 +107,12 @@ static void help_completer(struct i9e_completion_info *ci,
        cr->matches = i9e_complete_commands(ci->word, audiod_completers);
 }
 
+static void ll_completer(struct i9e_completion_info *ci,
+               struct i9e_completion_result *cr)
+{
+       i9e_ll_completer(ci, cr);
+}
+
 static void version_completer(struct i9e_completion_info *ci,
                struct i9e_completion_result *cr)
 {
@@ -165,11 +171,11 @@ static int audioc_post_monitor(struct sched *s, void *context)
        if (!sched_read_ok(at->fd, s))
                return 0;
        bufsize = PARA_MAX(1024U, OPT_UINT32_VAL(BUFSIZE));
-       buf = para_malloc(bufsize);
+       buf = alloc(bufsize);
        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);
@@ -239,10 +245,9 @@ __noreturn static void interactive_session(void)
        if (OPT_GIVEN(HISTORY_FILE))
                history_file = para_strdup(OPT_STRING_VAL(HISTORY_FILE));
        else {
-               char *home = para_homedir();
+               const char *home = get_homedir();
                history_file = make_message("%s/.paraslash/audioc.history",
                        home);
-               free(home);
        }
        ici.history_file = history_file;
 
@@ -364,7 +369,7 @@ int main(int argc, char *argv[])
        if (ret < 0)
                goto out;
        bufsize = PARA_MAX(1024U, OPT_UINT32_VAL(BUFSIZE));
-       buf = para_malloc(bufsize);
+       buf = alloc(bufsize);
        do {
                size_t n = ret = recv_bin_buffer(fd, buf, bufsize);
                if (ret <= 0)