[asterisk-commits] ivaxer: branch ivaxer/ast_storage r281292 - /team/ivaxer/ast_storage/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Aug 8 15:39:03 CDT 2010


Author: ivaxer
Date: Sun Aug  8 15:39:00 2010
New Revision: 281292

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=281292
Log:
implemented the seek/tell 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=281292&r1=281291&r2=281292
==============================================================================
--- team/ivaxer/ast_storage/res/res_storage_odbc.c (original)
+++ team/ivaxer/ast_storage/res/res_storage_odbc.c Sun Aug  8 15:39:00 2010
@@ -771,11 +771,31 @@
 }
 
 static off_t se_tell(struct ast_storage *st, struct ast_storage_fileinst *fi) {
-	return 0;
+	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 lseek(fi->fd, 0, SEEK_CUR);
 }
 
 static off_t se_seek(struct ast_storage *st, struct ast_storage_fileinst *fi, off_t offset, int whence) {
-	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 lseek(fi->fd, offset, whence);
 }
 
 static SQLHSTMT prepare_copy_query(struct odbc_obj *obj, void *arg)




More information about the asterisk-commits mailing list