From 0e32b6299010fd42fa043d4868e208cf29a31c1d Mon Sep 17 00:00:00 2001 From: leonid-ed Date: Fri, 31 Jul 2015 14:12:47 +0300 Subject: [PATCH] tests: fixed lv2ftpd --- tests/lv2ftpd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/lv2ftpd.c b/tests/lv2ftpd.c index 6ecbeb7..49df47c 100644 --- a/tests/lv2ftpd.c +++ b/tests/lv2ftpd.c @@ -179,15 +179,15 @@ static int __dir_open(void *m, sexp_t *sx) return sxmsg_return(msg, SNE_BADPROTO); } - char *dir_name = sx->list->next->val; + char *dir_name = strdup(sx->list->next->val); if ( usrtc_isfull(_rd_streams) ) { - return sxmsg_return(msg, EINVAL); + return sxmsg_return(msg, SNE_TOOLONG); } datastream_t *item; if ( !(item = malloc(sizeof(datastream_t))) ) { - return sxmsg_return(msg, ENOMEM); + return sxmsg_return(msg, SNE_ENOMEM); } /* find free id */ @@ -204,7 +204,7 @@ static int __dir_open(void *m, sexp_t *sx) if ( !(dp = opendir(dir_name)) ) { pthread_rwlock_unlock(&_lock); free(item); - return sxmsg_return(msg, EINVAL); + return sxmsg_return(msg, SNE_FAILED); } /* init stream */ @@ -253,7 +253,7 @@ static int __dir_read(void *m, sexp_t *sx) pthread_rwlock_rdlock(&_lock); if ( !(node = usrtc_lookup(_rd_streams, &stid)) ) { pthread_rwlock_unlock(&_lock); - return sxmsg_return(msg, ENOENT); + return sxmsg_return(msg, SNE_INVALINDEX); } pthread_rwlock_unlock(&_lock); @@ -264,7 +264,7 @@ static int __dir_read(void *m, sexp_t *sx) printf("%s: readdir_r() is failed (%d)\n", __FUNCTION__, errno); #endif /* DEBUG */ pthread_rwlock_unlock(&_lock); - return sxmsg_return(msg, EINVAL); + return sxmsg_return(msg, SNE_FAILED); } if (!item->dres) {