From: Mark Michelson Date: Tue, 1 Jul 2008 23:36:40 +0000 (+0000) Subject: Add error message to failed open(2) calls inside the copy() function of X-Git-Tag: 1.4.22-rc1~155 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ddc2e2ca0a5853ea8a23c5c445f102433fc1263;p=thirdparty%2Fasterisk.git Add error message to failed open(2) calls inside the copy() function of app_voicemail. This idea came as part of my work in helping to resolve issue #12764. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127244 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 112469a994..97afbb2766 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -1546,11 +1546,11 @@ static int copy(char *infile, char *outfile) if (link(infile, outfile)) { #endif if ((ifd = open(infile, O_RDONLY)) < 0) { - ast_log(LOG_WARNING, "Unable to open %s in read-only mode\n", infile); + ast_log(LOG_WARNING, "Unable to open %s in read-only mode: %s\n", infile, strerror(errno)); return -1; } if ((ofd = open(outfile, O_WRONLY | O_TRUNC | O_CREAT, VOICEMAIL_FILE_MODE)) < 0) { - ast_log(LOG_WARNING, "Unable to open %s in write-only mode\n", outfile); + ast_log(LOG_WARNING, "Unable to open %s in write-only mode: %s\n", outfile, strerror(errno)); close(ifd); return -1; }