[asterisk-commits] ivaxer: branch ivaxer/ast_storage r281291 - /team/ivaxer/ast_storage/res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Aug 8 14:47:15 CDT 2010
Author: ivaxer
Date: Sun Aug 8 14:47:12 2010
New Revision: 281291
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=281291
Log:
implemented the read/write functions of odbc backend
Modified:
team/ivaxer/ast_storage/res/res_storage_odbc.c
Modified: team/ivaxer/ast_storage/res/res_storage_odbc.c
URL: http://svnview.digium.com/svn/asterisk/team/ivaxer/ast_storage/res/res_storage_odbc.c?view=diff&rev=281291&r1=281290&r2=281291
==============================================================================
--- team/ivaxer/ast_storage/res/res_storage_odbc.c (original)
+++ team/ivaxer/ast_storage/res/res_storage_odbc.c Sun Aug 8 14:47:12 2010
@@ -742,12 +742,32 @@
static ssize_t se_read(struct ast_storage *st, struct ast_storage_fileinst *fi, void *buf, size_t count)
{
- return -1;
+ if (!fi) {
+ ast_log(LOG_WARNING, "read() failed: fileinst is NULL");
+ return -1;
+ }
+
+ if(fi->fd == -1) {
+ ast_log(LOG_WARNING, "read() failed: fileinst is closed");
+ return -1;
+ }
+
+ return read(fi->fd, buf, count);
}
static ssize_t se_write(struct ast_storage *st, struct ast_storage_fileinst *fi, void *buf, size_t count)
{
- return -1;
+ if (!fi) {
+ ast_log(LOG_WARNING, "write() failed: fileinst is NULL");
+ return -1;
+ }
+
+ if(fi->fd == -1) {
+ ast_log(LOG_WARNING, "write() failed: fileinst is closed");
+ return -1;
+ }
+
+ return write(fi->fd, buf, count);
}
static off_t se_tell(struct ast_storage *st, struct ast_storage_fileinst *fi) {
More information about the asterisk-commits
mailing list