aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_directory.c
diff options
context:
space:
mode:
authorautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-29 17:04:00 +0000
committerautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-03-29 17:04:00 +0000
commit7352220be0a924426d375d1f29346bf7bc7dc6ae (patch)
treed78225e2f65676feade603c780712ea6accdca93 /apps/app_directory.c
parent4a0675ab443c417ff532d6d7a15ad11fc826034e (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@59354 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directory.c')
-rw-r--r--apps/app_directory.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index 9caefc030..2b1d4e967 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -94,7 +94,7 @@ static void retrieve_file(char *dir)
int res;
int fd=-1;
size_t fdlen = 0;
- void *fdm=NULL;
+ void *fdm = MAP_FAILED;
SQLHSTMT stmt;
char sql[256];
char fmt[80]="";
@@ -161,7 +161,7 @@ static void retrieve_file(char *dir)
if (fd > -1)
fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
}
- if (fdm) {
+ if (fdm != MAP_FAILED) {
memset(fdm, 0, fdlen);
res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, fdlen, &colsize);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
@@ -174,7 +174,7 @@ static void retrieve_file(char *dir)
} while (0);
} else
ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
- if (fdm)
+ if (fdm != MAP_FAILED)
munmap(fdm, fdlen);
if (fd > -1)
close(fd);