[asterisk-commits] tilghman: branch 1.4 r102576 - /branches/1.4/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 5 18:26:02 CST 2008


Author: tilghman
Date: Tue Feb  5 18:26:02 2008
New Revision: 102576

URL: http://svn.digium.com/view/asterisk?view=rev&rev=102576
Log:
Move around some defines to unbreak ODBC storage.
(closes issue #11932)
 Reported by: snuffy

Modified:
    branches/1.4/apps/app_voicemail.c

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=102576&r1=102575&r2=102576
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Tue Feb  5 18:26:02 2008
@@ -1479,6 +1479,30 @@
 }
 #endif
 
+/*
+ * A negative return value indicates an error.
+ */
+#if (!defined(IMAP_STORAGE) && !defined(ODBC_STORAGE))
+static int last_message_index(struct ast_vm_user *vmu, char *dir)
+{
+	int x;
+	char fn[PATH_MAX];
+
+	if (vm_lock_path(dir))
+		return ERROR_LOCK_PATH;
+
+	for (x = 0; x < vmu->maxmsg; x++) {
+		make_file(fn, sizeof(fn), dir, x);
+		if (ast_fileexists(fn, NULL, NULL) < 1)
+			break;
+	}
+	ast_unlock_path(dir);
+
+	return x - 1;
+}
+#endif
+#endif
+
 static int copy(char *infile, char *outfile)
 {
 	int ifd;
@@ -1538,31 +1562,6 @@
 	copy(frompath2, topath2);
 }
 
-/*
- * A negative return value indicates an error.
- */
-#if (!defined(IMAP_STORAGE) && !defined(ODBC_STORAGE))
-static int last_message_index(struct ast_vm_user *vmu, char *dir)
-{
-	int x;
-	char fn[PATH_MAX];
-
-	if (vm_lock_path(dir))
-		return ERROR_LOCK_PATH;
-
-	for (x = 0; x < vmu->maxmsg; x++) {
-		make_file(fn, sizeof(fn), dir, x);
-		if (ast_fileexists(fn, NULL, NULL) < 1)
-			break;
-	}
-	ast_unlock_path(dir);
-
-	return x - 1;
-}
-#endif
-#endif
-
-#ifndef ODBC_STORAGE
 static int vm_delete(char *file)
 {
 	char *txt;
@@ -1577,7 +1576,6 @@
 	unlink(txt);
 	return ast_filedelete(file, NULL);
 }
-#endif
 
 static int inbuf(struct baseio *bio, FILE *fi)
 {
@@ -4240,7 +4238,7 @@
 		}
 
 		/* Remove surrogate file */
-		DELETE(tmpdir, curmsg, msgfile);
+		vm_delete(msgfile);
 	}
 
 	/* If anything failed above, we still have this list to free */




More information about the asterisk-commits mailing list