tests: fixed lv2ftpd

v0.5.xx
leonid-ed 10 years ago
parent 421d40a998
commit 0e32b62990

@ -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) {

Loading…
Cancel
Save